提交 c6f71c41 编写于 作者: H Haiyang Zhang 提交者: David S. Miller

hv_netvsc: Fix rndis_filter_close error during netvsc_remove

We now remove rndis filter before unregister_netdev(), which calls
device close. It involves closing rndis filter already removed.

This patch fixes this error.
Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0cf3f4c3
......@@ -119,12 +119,16 @@ static int netvsc_close(struct net_device *net)
struct net_device *vf_netdev
= rtnl_dereference(net_device_ctx->vf_netdev);
struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev);
int ret;
int ret = 0;
u32 aread, i, msec = 10, retry = 0, retry_max = 20;
struct vmbus_channel *chn;
netif_tx_disable(net);
/* No need to close rndis filter if it is removed already */
if (!nvdev)
goto out;
ret = rndis_filter_close(nvdev);
if (ret != 0) {
netdev_err(net, "unable to close device (ret %d).\n", ret);
......@@ -163,6 +167,7 @@ static int netvsc_close(struct net_device *net)
ret = -ETIMEDOUT;
}
out:
if (vf_netdev)
dev_close(vf_netdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册