Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268046
b: refs/heads/master
c: 124f506
h: refs/heads/master
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Aug 29, 2011
1 parent 8847494 commit d644312
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3852409b88e8ec2a8abb28db5be25a7503297208
refs/heads/master: 124f506dc1bbfc79c32dd17566f09ef51f7cf863
24 changes: 2 additions & 22 deletions trunk/drivers/staging/hv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,6 @@ static void put_net_device(struct hv_device *device)
atomic_dec(&net_device->refcnt);
}

static struct netvsc_device *release_inbound_net_device(
struct hv_device *device)
{
struct netvsc_device *net_device;

net_device = device->ext;
if (net_device == NULL)
return NULL;

/* Busy wait until the ref drop to 1, then set it to 0 */
while (atomic_cmpxchg(&net_device->refcnt, 1, 0) != 1)
udelay(100);

device->ext = NULL;
return net_device;
}

static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
{
struct nvsp_message *revoke_packet;
Expand Down Expand Up @@ -400,9 +383,8 @@ int netvsc_device_remove(struct hv_device *device)

netvsc_disconnect_vsp(net_device);

/* Stop inbound traffic ie receives and sends completions */
net_device = release_inbound_net_device(device);

atomic_dec(&net_device->refcnt);
device->ext = NULL;
/*
* Wait until the ref cnt falls to 0.
* We have already stopped any new references
Expand Down Expand Up @@ -967,8 +949,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
kfree(packet);
}

release_inbound_net_device(device);

kfree(net_device);
}

Expand Down

0 comments on commit d644312

Please sign in to comment.