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>
This commit is contained in:
Wei Yongjun 2012-01-24 10:21:28 +00:00 коммит произвёл David S. Miller
Родитель 2bbba277a5
Коммит c11bf1c8ba
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -68,11 +68,11 @@ static void do_set_multicast(struct work_struct *w)
nvdev = hv_get_drvdata(ndevctx->device_ctx); nvdev = hv_get_drvdata(ndevctx->device_ctx);
if (nvdev == NULL) if (nvdev == NULL)
return; goto out;
rdev = nvdev->extension; rdev = nvdev->extension;
if (rdev == NULL) if (rdev == NULL)
return; goto out;
if (net->flags & IFF_PROMISC) if (net->flags & IFF_PROMISC)
rndis_filter_set_packet_filter(rdev, 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_ALL_MULTICAST |
NDIS_PACKET_TYPE_DIRECTED); NDIS_PACKET_TYPE_DIRECTED);
out:
kfree(w); kfree(w);
} }