提交 2ef77143 编写于 作者: K K. Y. Srinivasan 提交者: 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: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c38b9c71
...@@ -56,7 +56,8 @@ static struct netvsc_device *get_outbound_net_device(struct hv_device *device) ...@@ -56,7 +56,8 @@ static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
struct netvsc_device *net_device; struct netvsc_device *net_device;
net_device = device->ext; 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); atomic_inc(&net_device->refcnt);
else else
net_device = NULL; net_device = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册