Skip to content

Commit

Permalink
net/hyperv: fix possible memory leak in do_set_multicast()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Jan 24, 2012
1 parent 2bbba27 commit c11bf1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/hyperv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
}

Expand Down

0 comments on commit c11bf1c

Please sign in to comment.