]> err.no Git - linux-2.6/commitdiff
[PATCH] um: fix a memory leak in the multicast driver
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Thu, 8 Mar 2007 04:41:09 +0000 (20:41 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 8 Mar 2007 15:38:21 +0000 (07:38 -0800)
Memory allocated by mcast_user_init must be freed in the matching mcast_remove.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/drivers/mcast_user.c

index 8138f5ea1bf7516272de7b086ead9ca8295306ea..b827e82884c98ad7ecf266387dd722fe6b6edede 100644 (file)
@@ -50,6 +50,14 @@ static void mcast_user_init(void *data, void *dev)
        pri->dev = dev;
 }
 
+static void mcast_remove(void *data)
+{
+       struct mcast_data *pri = data;
+
+       kfree(pri->mcast_addr);
+       pri->mcast_addr = NULL;
+}
+
 static int mcast_open(void *data)
 {
        struct mcast_data *pri = data;
@@ -157,7 +165,7 @@ const struct net_user_info mcast_user_info = {
        .init           = mcast_user_init,
        .open           = mcast_open,
        .close          = mcast_close,
-       .remove         = NULL,
+       .remove         = mcast_remove,
        .set_mtu        = mcast_set_mtu,
        .add_address    = NULL,
        .delete_address = NULL,