virtio: fix out of range array access
[linux-2.6.git] / drivers / virtio / virtio_pci.c
index 1d5191f..1b65732 100644 (file)
@@ -473,7 +473,8 @@ static void vp_del_vqs(struct virtio_device *vdev)
 
        list_for_each_entry_safe(vq, n, &vdev->vqs, list) {
                info = vq->priv;
-               if (vp_dev->per_vq_vectors)
+               if (vp_dev->per_vq_vectors &&
+                       info->msix_vector != VIRTIO_MSI_NO_VECTOR)
                        free_irq(vp_dev->msix_entries[info->msix_vector].vector,
                                 vq);
                vp_del_vq(vq);