Re: [PATCH v3 1/4] s390/pci: Fix leak of struct pci_dev reference in zpci_report_status()
From: Farhan Ali
Date: Thu Sep 17 2026 - 19:40:39 EST
On 9/16/2026 8:14 AM, Niklas Schnelle wrote:
In zpci_report_status(), a reference to the pdev associated with the
zdev being reported about is acquired using pci_get_slot(). This
reference needs to be dropped with pci_dev_put(), but this call is
missing, thus leaking the reference. On subsequent hot unplug, this will
cause the struct pci_dev to not be released, leaking memory and
preventing reattach.
At the same time, the only existing caller already holds a pdev
reference. So instead of reacquiring and then dropping another reference,
simply pass the existing pdev pointer to zpci_report_status(). This gets
rid of the need for pci_get_slot() as well as the zdev->zbus check.
Cc:stable@xxxxxxxxxxxxxxx
Fixes: 4ec6054e7321 ("s390/pci: Report PCI error recovery results via SCLP")
Signed-off-by: Niklas Schnelle<schnelle@xxxxxxxxxxxxx>
---
arch/s390/pci/pci_event.c | 2 +-
arch/s390/pci/pci_report.c | 11 +++++------
arch/s390/pci/pci_report.h | 4 +++-
3 files changed, 9 insertions(+), 8 deletions(-)
Reviewed-by: Farhan Ali <alifm@xxxxxxxxxxxxx>