lkml.org 
[lkml]   [2011]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 18/40] Staging: hv: netvsc: Prevent outgoing traffic when netvsc dev is destroyed
Date
Prevent outgoing traffic when netvsc dev is destroyed.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/netvsc.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 531de63..3ac0e17 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -60,7 +60,8 @@ static struct netvsc_device *get_outbound_net_device(struct hv_device *device)

spin_lock_irqsave(&device->ext_lock, flags);
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;
--
1.7.4.1


\
 
 \ /
  Last update: 2011-06-29 16:33    [W:0.203 / U:8.924 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site