Skip to content

Commit 05a2538

Browse files
niklas88hcahca
authored andcommitted
s390/pci: Fix duplicate pci_dev_put() in disable_slot() when PF has child VFs
With commit bcb5d6c ("s390/pci: introduce lock to synchronize state of zpci_dev's") the code to ignore power off of a PF that has child VFs was changed from a direct return to a goto to the unlock and pci_dev_put() section. The change however left the existing pci_dev_put() untouched resulting in a doubple put. This can subsequently cause a use after free if the struct pci_dev is released in an unexpected state. Fix this by removing the extra pci_dev_put(). Cc: stable@vger.kernel.org Fixes: bcb5d6c ("s390/pci: introduce lock to synchronize state of zpci_dev's") Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent 42420c5 commit 05a2538

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/pci/hotplug/s390_pci_hpc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
5959

6060
pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn);
6161
if (pdev && pci_num_vf(pdev)) {
62-
pci_dev_put(pdev);
6362
rc = -EBUSY;
6463
goto out;
6564
}

0 commit comments

Comments
 (0)