提交 8348e046 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

hv_netvsc: disable NAPI before channel close

This makes sure that no CPU is still process packets when
the channel is closed.

Fixes: 76bb5db5 ("netvsc: fix use after free on module removal")
Signed-off-by: NStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 68e2ffde
......@@ -568,6 +568,10 @@ void netvsc_device_remove(struct hv_device *device)
RCU_INIT_POINTER(net_device_ctx->nvdev, NULL);
/* And disassociate NAPI context from device */
for (i = 0; i < net_device->num_chn; i++)
netif_napi_del(&net_device->chan_table[i].napi);
/*
* At this point, no one should be accessing net_device
* except in here
......@@ -579,10 +583,6 @@ void netvsc_device_remove(struct hv_device *device)
netvsc_teardown_gpadl(device, net_device);
/* And dissassociate NAPI context from device */
for (i = 0; i < net_device->num_chn; i++)
netif_napi_del(&net_device->chan_table[i].napi);
/* Release all resources */
free_netvsc_device_rcu(net_device);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册