aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2007-03-07 23:41:09 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-08 10:38:21 -0500
commit83f4e8afc9a22eabb1c4cb771ffcb3af81734082 (patch)
treeb3b9f807633c9c67131dc7448a79520b860ac7f0 /arch/um
parenta6eb0be6d5cc1851deb6619e6f8b1bbd0a0dbab4 (diff)
[PATCH] um: fix a memory leak in the multicast driver
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>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/drivers/mcast_user.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/um/drivers/mcast_user.c b/arch/um/drivers/mcast_user.c
index 8138f5ea1bf7..b827e82884c9 100644
--- a/arch/um/drivers/mcast_user.c
+++ b/arch/um/drivers/mcast_user.c
@@ -50,6 +50,14 @@ static void mcast_user_init(void *data, void *dev)
50 pri->dev = dev; 50 pri->dev = dev;
51} 51}
52 52
53static void mcast_remove(void *data)
54{
55 struct mcast_data *pri = data;
56
57 kfree(pri->mcast_addr);
58 pri->mcast_addr = NULL;
59}
60
53static int mcast_open(void *data) 61static int mcast_open(void *data)
54{ 62{
55 struct mcast_data *pri = data; 63 struct mcast_data *pri = data;
@@ -157,7 +165,7 @@ const struct net_user_info mcast_user_info = {
157 .init = mcast_user_init, 165 .init = mcast_user_init,
158 .open = mcast_open, 166 .open = mcast_open,
159 .close = mcast_close, 167 .close = mcast_close,
160 .remove = NULL, 168 .remove = mcast_remove,
161 .set_mtu = mcast_set_mtu, 169 .set_mtu = mcast_set_mtu,
162 .add_address = NULL, 170 .add_address = NULL,
163 .delete_address = NULL, 171 .delete_address = NULL,