Commit 83f4e8af authored by Paolo 'Blaisorblade' Giarrusso's avatar Paolo 'Blaisorblade' Giarrusso Committed by Linus Torvalds

[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: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a6eb0be6
...@@ -50,6 +50,14 @@ static void mcast_user_init(void *data, void *dev) ...@@ -50,6 +50,14 @@ static void mcast_user_init(void *data, void *dev)
pri->dev = 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) static int mcast_open(void *data)
{ {
struct mcast_data *pri = data; struct mcast_data *pri = data;
...@@ -157,7 +165,7 @@ const struct net_user_info mcast_user_info = { ...@@ -157,7 +165,7 @@ const struct net_user_info mcast_user_info = {
.init = mcast_user_init, .init = mcast_user_init,
.open = mcast_open, .open = mcast_open,
.close = mcast_close, .close = mcast_close,
.remove = NULL, .remove = mcast_remove,
.set_mtu = mcast_set_mtu, .set_mtu = mcast_set_mtu,
.add_address = NULL, .add_address = NULL,
.delete_address = NULL, .delete_address = NULL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment