Skip to content

Commit

Permalink
hv_netvsc: fix error unwind handling if vmbus_open fails
Browse files Browse the repository at this point in the history
Need to delete NAPI association if vmbus_open fails.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Mar 5, 2018
1 parent f4950e4 commit fcfb4a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/hyperv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,6 @@ struct netvsc_device *netvsc_device_add(struct hv_device *device,
netvsc_channel_cb, net_device->chan_table);

if (ret != 0) {
netif_napi_del(&net_device->chan_table[0].napi);
netdev_err(ndev, "unable to open channel: %d\n", ret);
goto cleanup;
}
Expand Down Expand Up @@ -1319,6 +1318,7 @@ struct netvsc_device *netvsc_device_add(struct hv_device *device,
vmbus_close(device->channel);

cleanup:
netif_napi_del(&net_device->chan_table[0].napi);
free_netvsc_device(&net_device->rcu);

return ERR_PTR(ret);
Expand Down

0 comments on commit fcfb4a0

Please sign in to comment.