* [PATCH] net/hyperv: fix possible memory leak in do_set_multicast()
@ 2012-01-24 20:21 Haiyang Zhang
2012-01-24 20:48 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Haiyang Zhang @ 2012-01-24 20:21 UTC (permalink / raw)
To: haiyangz, kys, davem, netdev, linux-kernel; +Cc: Wei Yongjun
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
do_set_multicast() may not free the memory malloc in
netvsc_set_multicast_list().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net/hyperv: fix possible memory leak in do_set_multicast()
2012-01-24 20:21 [PATCH] net/hyperv: fix possible memory leak in do_set_multicast() Haiyang Zhang
@ 2012-01-24 20:48 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-01-24 20:48 UTC (permalink / raw)
To: haiyangz; +Cc: kys, netdev, linux-kernel, yongjun_wei
From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Tue, 24 Jan 2012 12:21:28 -0800
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> do_set_multicast() may not free the memory malloc in
> netvsc_set_multicast_list().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-24 20:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-24 20:21 [PATCH] net/hyperv: fix possible memory leak in do_set_multicast() Haiyang Zhang
2012-01-24 20:48 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).