Skip to content

Commit 249f255

Browse files
paravmellanoxmstsirkin
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 60f0779 commit 249f255

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/virtio/virtio_ring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2291,6 +2291,8 @@ void vring_del_virtqueue(struct virtqueue *_vq)
22912291
{
22922292
struct vring_virtqueue *vq = to_vvq(_vq);
22932293

2294+
list_del(&_vq->list);
2295+
22942296
if (vq->we_own_ring) {
22952297
if (vq->packed_ring) {
22962298
vring_free_queue(vq->vq.vdev,
@@ -2321,7 +2323,6 @@ void vring_del_virtqueue(struct virtqueue *_vq)
23212323
kfree(vq->split.desc_state);
23222324
kfree(vq->split.desc_extra);
23232325
}
2324-
list_del(&_vq->list);
23252326
kfree(vq);
23262327
}
23272328
EXPORT_SYMBOL_GPL(vring_del_virtqueue);

0 commit comments

Comments
 (0)