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

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
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment