Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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,