Skip to content

Commit b6cd170

Browse files
committed
Merge tag 'vfio-v6.6-rc4' of https://github.com/awilliam/linux-vfio
Pull VFIO fixes from Alex Williamson: - The new PDS vfio-pci variant driver only supports SR-IOV VF devices and incorrectly made a direct reference to the physfn field of the pci_dev. Fix this both by making the Kconfig depend on IOV support as well as using the correct wrapper for this access (Shixiong Ou) - Resolve an error path issue where on unwind of the mdev registration the created kset is not unregistered and the wrong error code is returned (Jinjie Ruan) * tag 'vfio-v6.6-rc4' of https://github.com/awilliam/linux-vfio: vfio/mdev: Fix a null-ptr-deref bug for mdev_unregister_parent() vfio/pds: Use proper PF device access helper vfio/pds: Add missing PCI_IOV depends
2 parents 0e94513 + c777b11 commit b6cd170

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

drivers/vfio/mdev/mdev_sysfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ int parent_create_sysfs_files(struct mdev_parent *parent)
233233
out_err:
234234
while (--i >= 0)
235235
mdev_type_remove(parent->types[i]);
236-
return 0;
236+
kset_unregister(parent->mdev_types_kset);
237+
return ret;
237238
}
238239

239240
static ssize_t remove_store(struct device *dev, struct device_attribute *attr,

drivers/vfio/pci/pds/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
config PDS_VFIO_PCI
55
tristate "VFIO support for PDS PCI devices"
6-
depends on PDS_CORE
6+
depends on PDS_CORE && PCI_IOV
77
select VFIO_PCI_CORE
88
help
99
This provides generic PCI support for PDS devices using the VFIO

drivers/vfio/pci/pds/vfio_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static int pds_vfio_init_device(struct vfio_device *vdev)
162162
pci_id = PCI_DEVID(pdev->bus->number, pdev->devfn);
163163
dev_dbg(&pdev->dev,
164164
"%s: PF %#04x VF %#04x vf_id %d domain %d pds_vfio %p\n",
165-
__func__, pci_dev_id(pdev->physfn), pci_id, vf_id,
165+
__func__, pci_dev_id(pci_physfn(pdev)), pci_id, vf_id,
166166
pci_domain_nr(pdev->bus), pds_vfio);
167167

168168
return 0;

0 commit comments

Comments
 (0)