mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 05:04:00 +08:00
[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>
This commit is contained in:
parent
a6eb0be6d5
commit
83f4e8afc9
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user