Skip to content

Commit

Permalink
Staging: hv: netvsc: Cleanup alloc_net_device()
Browse files Browse the repository at this point in the history
Cleanup alloc_net_device(); we can directly set the refcnt.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Aug 29, 2011
1 parent 356c465 commit 509ee38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/hv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device)
return NULL;

/* Set to 2 to allow both inbound and outbound traffic */
atomic_cmpxchg(&net_device->refcnt, 0, 2);
atomic_set(&net_device->refcnt, 2);

net_device->dev = device;
device->ext = net_device;
Expand Down

0 comments on commit 509ee38

Please sign in to comment.