public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irlmp_unregister_link needs to free lsaps hashbin
@ 2007-10-12 12:56 hinko.kocevar
  2007-10-13  1:03 ` [irda-users] " Samuel Ortiz
  0 siblings, 1 reply; 3+ messages in thread
From: hinko.kocevar @ 2007-10-12 12:56 UTC (permalink / raw)
  To: irda-users; +Cc: Samuel Ortiz, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

Hi,

While testing the mcs7780 based IrDA USB dongle I've stumbled upon
memory leak in irlmp_unregister_link(). Hashbin for lsaps is created in
irlmp_register_link and should probably be freed in irlmp_unregister_link().

Signed-off-by: Hinko Kocevar <hinko.kocevar@cetrtapot.si>

Best regards,
Hinko

----



[-- Attachment #2: irlmp-delete-lsaps-hashbin.diff --]
[-- Type: text/plain, Size: 355 bytes --]

--- linux-2.6.23/net/irda/irlmp.c.orig	2007-10-12 14:05:17.000000000 +0200
+++ linux-2.6.23/net/irda/irlmp.c	2007-10-12 14:05:41.000000000 +0200
@@ -353,6 +353,7 @@ void irlmp_unregister_link(__u32 saddr)
 		/* Final cleanup */
 		del_timer(&link->idle_timer);
 		link->magic = 0;
+		hashbin_delete(link->lsaps, (FREE_FUNC) kfree);
 		kfree(link);
 	}
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [irda-users] [PATCH] irlmp_unregister_link needs to free lsaps hashbin
  2007-10-12 12:56 [PATCH] irlmp_unregister_link needs to free lsaps hashbin hinko.kocevar
@ 2007-10-13  1:03 ` Samuel Ortiz
  2007-10-15  7:43   ` hinko.kocevar
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Ortiz @ 2007-10-13  1:03 UTC (permalink / raw)
  To: hinko.kocevar@cetrtapot.si; +Cc: irda-users, linux-kernel

Hi Hinko,

On Fri, Oct 12, 2007 at 02:56:27PM +0200, hinko.kocevar@cetrtapot.si wrote:
> Hi,
> 
> While testing the mcs7780 based IrDA USB dongle I've stumbled upon
> memory leak in irlmp_unregister_link(). Hashbin for lsaps is created in
> irlmp_register_link and should probably be freed in irlmp_unregister_link().
> 
> Signed-off-by: Hinko Kocevar <hinko.kocevar@cetrtapot.si>
> 
> Best regards,
> Hinko
> 
> ----
> 
> 

> --- linux-2.6.23/net/irda/irlmp.c.orig	2007-10-12 14:05:17.000000000 +0200
> +++ linux-2.6.23/net/irda/irlmp.c	2007-10-12 14:05:41.000000000 +0200
> @@ -353,6 +353,7 @@ void irlmp_unregister_link(__u32 saddr)
>  		/* Final cleanup */
>  		del_timer(&link->idle_timer);
>  		link->magic = 0;
> +		hashbin_delete(link->lsaps, (FREE_FUNC) kfree);
Good catch, but I think the right fix sould be:
+             hashbin_delete(link->lsaps, (FREE_FUNC) __irlmp_close_lsap);

and I'll forward it. Thanks a lot.

Cheers,
Samuel.


>  		kfree(link);
>  	}
>  }

> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> irda-users mailing list
> irda-users@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/irda-users



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [irda-users] [PATCH] irlmp_unregister_link needs to free lsaps hashbin
  2007-10-13  1:03 ` [irda-users] " Samuel Ortiz
@ 2007-10-15  7:43   ` hinko.kocevar
  0 siblings, 0 replies; 3+ messages in thread
From: hinko.kocevar @ 2007-10-15  7:43 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: irda-users, linux-kernel

Samuel Ortiz wrote:
> Hi Hinko,
> 
> On Fri, Oct 12, 2007 at 02:56:27PM +0200, hinko.kocevar@cetrtapot.si wrote:
>> Hi,
>>
>> While testing the mcs7780 based IrDA USB dongle I've stumbled upon
>> memory leak in irlmp_unregister_link(). Hashbin for lsaps is created in
>> irlmp_register_link and should probably be freed in irlmp_unregister_link().
>>
>> Signed-off-by: Hinko Kocevar <hinko.kocevar@cetrtapot.si>
>>
>> Best regards,
>> Hinko
>>
>> ----
>>
>>
> 
>> --- linux-2.6.23/net/irda/irlmp.c.orig	2007-10-12 14:05:17.000000000 +0200
>> +++ linux-2.6.23/net/irda/irlmp.c	2007-10-12 14:05:41.000000000 +0200
>> @@ -353,6 +353,7 @@ void irlmp_unregister_link(__u32 saddr)
>>  		/* Final cleanup */
>>  		del_timer(&link->idle_timer);
>>  		link->magic = 0;
>> +		hashbin_delete(link->lsaps, (FREE_FUNC) kfree);
> Good catch, but I think the right fix sould be:
> +             hashbin_delete(link->lsaps, (FREE_FUNC) __irlmp_close_lsap);
> 

You're probably right since struct lsap_cb get inserted into the hashbin.

Regards,
Hinko

-- 
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar@cetrtapot.si
Http: www.cetrtapot.si


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-15  7:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-12 12:56 [PATCH] irlmp_unregister_link needs to free lsaps hashbin hinko.kocevar
2007-10-13  1:03 ` [irda-users] " Samuel Ortiz
2007-10-15  7:43   ` hinko.kocevar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox