Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c11bf1c8 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller
Browse files

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2bbba277
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);
}