diff options
author | Eric Dumazet | 2016-11-15 22:24:12 -0800 |
---|---|---|
committer | David S. Miller | 2016-11-16 15:09:29 -0500 |
commit | 963abe5c8a0273a1cf5913556da1b1189de0e57a (patch) | |
tree | 9fbe435e14eb3f7b1ae33d14181bc6ee42739b54 /drivers/net/virtio_net.c | |
parent | a7741713dd361f081e5b48c04f59d0bbb1f32ed3 (diff) |
virtio-net: add a missing synchronize_net()
It seems many drivers do not respect napi_hash_del() contract.
When napi_hash_del() is used before netif_napi_del(), an RCU grace
period is needed before freeing NAPI object.
Fixes: 91815639d880 ("virtio-net: rx busy polling support")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index fd8b1e62301f..7276d5a95bd0 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1497,6 +1497,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); } |