summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-01-10 21:23:03 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2015-01-10 21:23:03 +0100
commit4850d37d3a7c049f7dc3eb09d7ae4e5553ac521b (patch)
treece7ace12d6a876ec67e248b3a4db431242c8bb82
parentMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/... (diff)
parentvfio-pci: Fix the check on pci device type in vfio_pci_probe() (diff)
downloadlinux-4850d37d3a7c049f7dc3eb09d7ae4e5553ac521b.tar.xz
linux-4850d37d3a7c049f7dc3eb09d7ae4e5553ac521b.zip
Merge tag 'vfio-v3.19-rc4' of git://github.com/awilliam/linux-vfio
Pull VFIO fix from Alex Williamson: "Fix PCI header check in vfio_pci_probe() (Wei Yang)" * tag 'vfio-v3.19-rc4' of git://github.com/awilliam/linux-vfio: vfio-pci: Fix the check on pci device type in vfio_pci_probe()
-rw-r--r--drivers/vfio/pci/vfio_pci.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 255201f22126..7cc0122a18ce 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -840,13 +840,11 @@ static const struct vfio_device_ops vfio_pci_ops = {
static int vfio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
- u8 type;
struct vfio_pci_device *vdev;
struct iommu_group *group;
int ret;
- pci_read_config_byte(pdev, PCI_HEADER_TYPE, &type);
- if ((type & PCI_HEADER_TYPE) != PCI_HEADER_TYPE_NORMAL)
+ if (pdev->hdr_type != PCI_HEADER_TYPE_NORMAL)
return -EINVAL;
group = iommu_group_get(&pdev->dev);