Skip to content

Commit 4850d37

Browse files
committed
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()
2 parents aff8ad5 + 7c2e211 commit 4850d37

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎drivers/vfio/pci/vfio_pci.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -840,13 +840,11 @@ static const struct vfio_device_ops vfio_pci_ops = {
840840

841841
static int vfio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
842842
{
843-
u8 type;
844843
struct vfio_pci_device *vdev;
845844
struct iommu_group *group;
846845
int ret;
847846

848-
pci_read_config_byte(pdev, PCI_HEADER_TYPE, &type);
849-
if ((type & PCI_HEADER_TYPE) != PCI_HEADER_TYPE_NORMAL)
847+
if (pdev->hdr_type != PCI_HEADER_TYPE_NORMAL)
850848
return -EINVAL;
851849

852850
group = iommu_group_get(&pdev->dev);

0 commit comments

Comments
 (0)