We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2c2df8 commit f961f72Copy full SHA for f961f72
virt/kvm/assigned-dev.c
@@ -635,7 +635,6 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm,
635
int r = 0, idx;
636
struct kvm_assigned_dev_kernel *match;
637
struct pci_dev *dev;
638
- u8 header_type;
639
640
if (!(assigned_dev->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU))
641
return -EINVAL;
@@ -668,8 +667,7 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm,
668
667
}
669
670
/* Don't allow bridges to be assigned */
671
- pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type);
672
- if ((header_type & PCI_HEADER_TYPE) != PCI_HEADER_TYPE_NORMAL) {
+ if (dev->hdr_type != PCI_HEADER_TYPE_NORMAL) {
673
r = -EPERM;
674
goto out_put;
675
0 commit comments