]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
hv_netvsc: cancel subchannel setup before halting device
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Mar 2018 21:49:04 +0000 (13:49 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Mar 2018 03:18:20 +0000 (22:18 -0500)
Block setup of multiple channels earlier in the teardown
process. This avoids possible races between halt and subchannel
initialization.

Suggested-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/rndis_filter.c

index c3ca191fea7fe6bc629ae45be0759cdf1f062956..1cba767c6453389d9718cb03d36d2e9632aa854c 100644 (file)
@@ -1340,6 +1340,9 @@ void rndis_filter_device_remove(struct hv_device *dev,
 {
        struct rndis_device *rndis_dev = net_dev->extension;
 
+       /* Don't try and setup sub channels if about to halt */
+       cancel_work_sync(&net_dev->subchan_work);
+
        /* Halt and release the rndis device */
        rndis_filter_halt_device(rndis_dev);