aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-01-24 05:21:28 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-24 15:47:47 -0500
commitc11bf1c8baff170fa478adc04964da519d160e62 (patch)
tree9d5b41ba4e07cb546097af97d9956b42b4cb91a8 /drivers/net/hyperv
parent2bbba277a554431a426e81f37d5c50ab6216c07d (diff)
net/hyperv: fix possible memory leak in do_set_multicast()
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r--drivers/net/hyperv/netvsc_drv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 462d05f05e84..1a1ca6cfc74a 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)
68 68
69 nvdev = hv_get_drvdata(ndevctx->device_ctx); 69 nvdev = hv_get_drvdata(ndevctx->device_ctx);
70 if (nvdev == NULL) 70 if (nvdev == NULL)
71 return; 71 goto out;
72 72
73 rdev = nvdev->extension; 73 rdev = nvdev->extension;
74 if (rdev == NULL) 74 if (rdev == NULL)
75 return; 75 goto out;
76 76
77 if (net->flags & IFF_PROMISC) 77 if (net->flags & IFF_PROMISC)
78 rndis_filter_set_packet_filter(rdev, 78 rndis_filter_set_packet_filter(rdev,
@@ -83,6 +83,7 @@ static void do_set_multicast(struct work_struct *w)
83 NDIS_PACKET_TYPE_ALL_MULTICAST | 83 NDIS_PACKET_TYPE_ALL_MULTICAST |
84 NDIS_PACKET_TYPE_DIRECTED); 84 NDIS_PACKET_TYPE_DIRECTED);
85 85
86out:
86 kfree(w); 87 kfree(w);
87} 88}
88 89