[PATCH] net/hyperv: fix possible memory leak in do_set_multicast()

Subsystems: hyper-v/azure core and drivers, networking drivers, the rest

STALE5315d

2 messages, 2 authors, 2012-01-24 · open the first message on its own page

[PATCH] net/hyperv: fix possible memory leak in do_set_multicast()

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: 2012-01-24 20:18:29

From: Wei Yongjun <redacted>

do_set_multicast() may not free the memory malloc in
netvsc_set_multicast_list().

Signed-off-by: Wei Yongjun <redacted>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>

---
 drivers/net/hyperv/netvsc_drv.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 462d05f..1a1ca6c 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -68,11 +68,11 @@ static void do_set_multicast(struct work_struct *w)
 
 	nvdev = hv_get_drvdata(ndevctx->device_ctx);
 	if (nvdev == NULL)
-		return;
+		goto out;
 
 	rdev = nvdev->extension;
 	if (rdev == NULL)
-		return;
+		goto out;
 
 	if (net->flags & IFF_PROMISC)
 		rndis_filter_set_packet_filter(rdev,
@@ -83,6 +83,7 @@ static void do_set_multicast(struct work_struct *w)
 			NDIS_PACKET_TYPE_ALL_MULTICAST |
 			NDIS_PACKET_TYPE_DIRECTED);
 
+out:
 	kfree(w);
 }
 
-- 
1.7.4.1

Re: [PATCH] net/hyperv: fix possible memory leak in do_set_multicast()

From: David Miller <davem@davemloft.net>
Date: 2012-01-24 20:49:45

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Tue, 24 Jan 2012 12:21:28 -0800
From: Wei Yongjun <redacted>

do_set_multicast() may not free the memory malloc in
netvsc_set_multicast_list().

Signed-off-by: Wei Yongjun <redacted>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help