Commit 3da09663 authored by David S. Miller's avatar David S. Miller

Merge branch 'hv_netvsc-fix-error-handling-in-netvsc_attach-set_features'

Haiyang Zhang says:

====================
hv_netvsc: fix error handling in netvsc_attach/set_features

The error handling code path in these functions are not correct.
This patch set fixes them.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents fc89cc35 719b85c3
......@@ -982,7 +982,7 @@ static int netvsc_attach(struct net_device *ndev,
if (netif_running(ndev)) {
ret = rndis_filter_open(nvdev);
if (ret)
return ret;
goto err;
rdev = nvdev->extension;
if (!rdev->link_state)
......@@ -990,6 +990,13 @@ static int netvsc_attach(struct net_device *ndev,
}
return 0;
err:
netif_device_detach(ndev);
rndis_filter_device_remove(hdev, nvdev);
return ret;
}
static int netvsc_set_channels(struct net_device *net,
......@@ -1807,8 +1814,10 @@ static int netvsc_set_features(struct net_device *ndev,
ret = rndis_filter_set_offload_params(ndev, nvdev, &offloads);
if (ret)
if (ret) {
features ^= NETIF_F_LRO;
ndev->features = features;
}
syncvf:
if (!vf_netdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment