]> git.baikalelectronics.ru Git - kernel.git/commit
vfio-pci: Fix the check on pci device type in vfio_pci_probe()
authorWei Yang <weiyang@linux.vnet.ibm.com>
Wed, 7 Jan 2015 17:29:11 +0000 (10:29 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 7 Jan 2015 17:29:11 +0000 (10:29 -0700)
commit37adf44b6da32445c9f6ec4ac6242d8247b20f71
tree2cbc83b9b08e1504fe283330915afdecc5e337db
parent981369db3df4f6e821d3554bc0046723423683ef
vfio-pci: Fix the check on pci device type in vfio_pci_probe()

Current vfio-pci just supports normal pci device, so vfio_pci_probe() will
return if the pci device is not a normal device. While current code makes a
mistake. PCI_HEADER_TYPE is the offset in configuration space of the device
type, but we use this value to mask the type value.

This patch fixs this by do the check directly on the pci_dev->hdr_type.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: stable@vger.kernel.org # v3.6+
drivers/vfio/pci/vfio_pci.c