[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux1394-devel
Subject:    Re: [PATCH] fix struct fw_node memory leak
From:       Stefan Richter <stefanr () s5r6 ! in-berlin ! de>
Date:       2008-10-26 11:09:25
Message-ID: tkrat.66ced0b5c0091055 () s5r6 ! in-berlin ! de
[Download RAW message or body]

On 16 Oct, Jay Fenlason wrote:
> With the bus_resets patch applied, it is easy to see this memory leak
> by repeatedly resetting the firewire bus while running slabtop in
> another window.  Just watch kmalloc-32 grow and grow...
> 
> Signed-off-by: Jay Fenlason <fenlason@redhat.com>
> 
> --- linux-for-next/drivers/firewire/fw-topology.c	2008-10-07 13:43:46.000000000 -0400
> +++ node-leak/drivers/firewire/fw-topology.c	2008-10-16 15:59:18.000000000 -0400
> @@ -413,7 +413,7 @@ static void
>  update_tree(struct fw_card *card, struct fw_node *root)
>  {
>  	struct list_head list0, list1;
> -	struct fw_node *node0, *node1;
> +	struct fw_node *node0, *node1, *next1;
>  	int i, event;
>  
>  	INIT_LIST_HEAD(&list0);
> @@ -485,7 +485,9 @@ update_tree(struct fw_card *card, struct
>  		}
>  
>  		node0 = fw_node(node0->link.next);
> -		node1 = fw_node(node1->link.next);
> +		next1 = fw_node(node1->link.next);
> +		fw_node_put(node1);
> +		node1 = next1;
>  	}
>  }
>  

Good work.  Committed to linux1394-2.6.git.  This and "Survive more than
256 bus resets" should go to mainline 2.6.28-rcX soon, and subsequently
to 2.6.27.y.
-- 
Stefan Richter
-=====-==--- =-=- ==-=-
http://arcgraph.de/sr/


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
mailing list linux1394-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux1394-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic