summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephen hemminger <stephen@networkplumber.org>2017-07-28 08:59:46 -0700
committerDavid S. Miller <davem@davemloft.net>2017-07-29 15:25:43 -0700
commit493933472d33d3e82d6323842edeb281199ee430 (patch)
treead529c6e0c399f54995778767c69e94325171395
parent7426b1a51803ba2d368177363a134b98b0a8d1c0 (diff)
netvsc: fix error unwind on device setup failure
If setting receive buffer fails, the error unwind would cause kernel panic because it was not correctly doing RCU and NAPI unwind. RCU'd pointer needs to be reset to NULL, and NAPI needs to be disabled not deleted. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/hyperv/netvsc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 4c709b454d34..db95487807fd 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1307,7 +1307,8 @@ struct netvsc_device *netvsc_device_add(struct hv_device *device,
return net_device;
close:
- netif_napi_del(&net_device->chan_table[0].napi);
+ RCU_INIT_POINTER(net_device_ctx->nvdev, NULL);
+ napi_disable(&net_device->chan_table[0].napi);
/* Now, we can close the channel safely */
vmbus_close(device->channel);