mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 08:17:46 +00:00
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: 91815639d8
("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>
This commit is contained in:
parent
a7741713dd
commit
963abe5c8a
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue