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

Commit 2ef77143 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman
Browse files

Staging: hv: netvsc: Prevent outgoing traffic when netvsc dev is destroyed



Prevent outgoing traffic when netvsc dev is destroyed.

Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c38b9c71
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -56,7 +56,8 @@ static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
	struct netvsc_device *net_device;

	net_device = device->ext;
	if (net_device && atomic_read(&net_device->refcnt) > 1)
	if (net_device && (atomic_read(&net_device->refcnt) > 1) &&
		!net_device->destroy)
		atomic_inc(&net_device->refcnt);
	else
		net_device = NULL;