diff options
author | Parav Pandit <parav@nvidia.com> | 2021-07-21 16:26:46 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-08-10 17:50:55 +0200 |
commit | 249f255476328e597a598ccdbd4414e51a5b6d6e (patch) | |
tree | 38b79bff52a3006e22ccaabef67be83919e2cdff /drivers/virtio | |
parent | virtio: Improve vq->broken access to avoid any compiler optimization (diff) | |
download | linux-249f255476328e597a598ccdbd4414e51a5b6d6e.tar.xz linux-249f255476328e597a598ccdbd4414e51a5b6d6e.zip |
virtio: Keep vring_del_virtqueue() mirror of VQ create
Keep the vring_del_virtqueue() mirror of the create routines.
i.e. to delete list entry first as it is added last during the create
routine.
Signed-off-by: Parav Pandit <parav@nvidia.com>
Link: https://lore.kernel.org/r/20210721142648.1525924-3-parav@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r-- | drivers/virtio/virtio_ring.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index e179c7c7622c..d5934c2e5a89 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -2291,6 +2291,8 @@ void vring_del_virtqueue(struct virtqueue *_vq) { struct vring_virtqueue *vq = to_vvq(_vq); + list_del(&_vq->list); + if (vq->we_own_ring) { if (vq->packed_ring) { vring_free_queue(vq->vq.vdev, @@ -2321,7 +2323,6 @@ void vring_del_virtqueue(struct virtqueue *_vq) kfree(vq->split.desc_state); kfree(vq->split.desc_extra); } - list_del(&_vq->list); kfree(vq); } EXPORT_SYMBOL_GPL(vring_del_virtqueue); |