From: Michael S. Tsirkin Date: Sun, 26 Jul 2009 12:48:01 +0000 (+0300) Subject: virtio: delete vq from list X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f6c82507030d61e15928d5cad946d3eac1c4a384;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git virtio: delete vq from list This makes delete vq the reverse of find vq. This is required to make it possible to retry find_vqs after a failure, otherwise the list gets corrupted. Signed-off-by: Michael S. Tsirkin Signed-off-by: Rusty Russell --- diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index ca40517ef9c..a1cb1a1c652 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -464,7 +464,11 @@ static void vp_del_vq(struct virtqueue *vq) { struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); struct virtio_pci_vq_info *info = vq->priv; - unsigned long size; + unsigned long flags, size; + + spin_lock_irqsave(&vp_dev->lock, flags); + list_del(&info->node); + spin_unlock_irqrestore(&vp_dev->lock, flags); iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL);