[IRDA]: irlmp_unregister_link() needs to free lsaps.
authorHinko Kocevar <hinko.kocevar@cetrtapot.si>
Sun, 16 Dec 2007 22:08:58 +0000 (14:08 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 Dec 2007 22:08:58 +0000 (14:08 -0800)
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>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/irda/irlmp.c

index cedff8068fbc17b3e4fe8f994ac5fc3f1ed22956..f24cb755908e223c9c39eb9dd89d70e4d633dc48 100644 (file)
@@ -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) __irlmp_close_lsap);
                kfree(link);
        }
 }