[openib-general] Re: [PATCH] mad.c memory leak

Roland Dreier rdreier at cisco.com
Wed Mar 15 13:13:37 PST 2006


 > --- user_mad.c	(revision 5693)
 > +++ user_mad.c	(working copy)
 > @@ -701,8 +701,11 @@ static int ib_umad_close(struct inode *i
 >  	already_dead = file->agents_dead;
 >  	file->agents_dead = 1;
 >  
 > -	list_for_each_entry_safe(packet, tmp, &file->recv_list, list)
 > +	list_for_each_entry_safe(packet, tmp, &file->recv_list, list) {
 > +		if (packet->recv_wc)
 > +			ib_free_recv_mad(packet->recv_wc);
 >  		kfree(packet);
 > +	}
 >  
 >  	list_del(&file->port_list);

Yes, this definitely looks like it is needed.

 - R.



More information about the general mailing list