Subject: [PATCH 3/5] [IrDA] irlmp_unregister_link needs to free lsaps

From: Samuel Ortiz <[email-masked]>
Date: Mon, 03 Dec 2007 10:28:34 +0100

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 <[email-masked]>
Signed-off-by: Samuel Ortiz <[email-masked]>

---
 net/irda/irlmp.c |    1 +
 1 file changed, 1 insertion(+)

Index: net-2.6/net/irda/irlmp.c
===================================================================
--- net-2.6.orig/net/irda/irlmp.c	2007-11-25 05:54:02.000000000 +0100
+++ net-2.6/net/irda/irlmp.c	2007-11-25 07:12:13.000000000 +0100
@@ -353,6 +353,7 @@
 		/* Final cleanup */
 		del_timer(&link->idle_timer);
 		link->magic = 0;
+		hashbin_delete(link->lsaps, (FREE_FUNC) __irlmp_close_lsap);
 		kfree(link);
 	}
 }

-- 

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4