gianfar: synchronize DMA API usage by free_skb_rx_queue w/ gfar_new_page
[firefly-linux-kernel-4.4.55.git] / drivers / net / virtio_net.c
index f94ab786088fc8fd7f848edeaedd4d2aff160606..7f7c87762bc69f19a1c13fbe7f8babc583e710f2 100644 (file)
@@ -1415,6 +1415,7 @@ static const struct net_device_ops virtnet_netdev = {
 #ifdef CONFIG_NET_RX_BUSY_POLL
        .ndo_busy_poll          = virtnet_busy_poll,
 #endif
+       .ndo_features_check     = passthru_features_check,
 };
 
 static void virtnet_config_changed_work(struct work_struct *work)
@@ -1465,6 +1466,11 @@ static void virtnet_free_queues(struct virtnet_info *vi)
                netif_napi_del(&vi->rq[i].napi);
        }
 
+       /* We called napi_hash_del() before netif_napi_del(),
+        * we need to respect an RCU grace period before freeing vi->rq
+        */
+       synchronize_net();
+
        kfree(vi->rq);
        kfree(vi->sq);
 }