Message ID | 20240129084150.134050-3-clg@redhat.com |
---|---|
State | New |
Headers | show |
Series | [PULL,1/2] vfio: use matching sizeof type | expand |
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index d7fe06715c4b9cde66a68c31aaf405315921b0d6..4fa387f0430d62ca2ba1b5ae5b7037f8f06b33f9 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -826,9 +826,11 @@ static void vfio_msix_disable(VFIOPCIDevice *vdev) } } - if (vdev->nr_vectors) { - vfio_disable_irqindex(&vdev->vbasedev, VFIO_PCI_MSIX_IRQ_INDEX); - } + /* + * Always clear MSI-X IRQ index. A PF device could have enabled + * MSI-X with no vectors. See vfio_msix_enable(). + */ + vfio_disable_irqindex(&vdev->vbasedev, VFIO_PCI_MSIX_IRQ_INDEX); vfio_msi_disable_common(vdev); vfio_intx_enable(vdev, &err);