vfio/pci-quirks: Exclude non-ioport BAR from NVIDIA quirk

The NVIDIA BAR5 quirk is targeting an ioport BAR.  Some older devices
have a BAR5 which is not ioport and can induce a segfault here.  Test
the BAR type to skip these devices.

Link: https://bugs.launchpad.net/qemu/+bug/1678466
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
Alex Williamson 2017-04-06 16:03:26 -06:00
parent 54d689988c
commit 8f419c5b43
1 changed files with 1 additions and 1 deletions

View File

@ -660,7 +660,7 @@ static void vfio_probe_nvidia_bar5_quirk(VFIOPCIDevice *vdev, int nr)
VFIOConfigWindowQuirk *window;
if (!vfio_pci_is(vdev, PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID) ||
!vdev->vga || nr != 5) {
!vdev->vga || nr != 5 || !vdev->bars[5].ioport) {
return;
}