[PATCH] s390/pci: Fix missing pci_dev_put() in zpci_report_status()

Niklas Schnelle posted 1 patch 1 month, 1 week ago
There is a newer version of this series
arch/s390/pci/pci_report.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] s390/pci: Fix missing pci_dev_put() in zpci_report_status()
Posted by Niklas Schnelle 1 month, 1 week ago
In zpci_report_status() a reference to the struct pci_dev associated
with the struct zpci_dev 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 potentially prevent reattach.

Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Fixes: 4ec6054e7321 ("s390/pci: Report PCI error recovery results via SCLP")
Cc: stable@vger.kernel.org
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
---
 arch/s390/pci/pci_report.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/s390/pci/pci_report.c b/arch/s390/pci/pci_report.c
index 7030f7052926..76b8afc146fe 100644
--- a/arch/s390/pci/pci_report.c
+++ b/arch/s390/pci/pci_report.c
@@ -151,6 +151,7 @@ int zpci_report_status(struct zpci_dev *zdev, const char *operation, const char
 	else
 		pr_info("Reported PCI device status\n");
 
+	pci_dev_put(pdev);
 	free_page((unsigned long)report);
 
 	return ret;

---
base-commit: 8d3ae59288f1e7d58d76558a6ee96d533bc5019f
change-id: 20260817-fix_zpci_report_status_pdev_leak-1b101c1fe021

Best regards,
-- 
Niklas Schnelle
Re: [PATCH] s390/pci: Fix missing pci_dev_put() in zpci_report_status()
Posted by Farhan Ali 1 month, 1 week ago
On 8/18/2026 12:17 PM, Niklas Schnelle wrote:
> In zpci_report_status() a reference to the struct pci_dev associated
> with the struct zpci_dev 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 potentially prevent reattach.
>
> Reviewed-by: Matthew Rosato<mjrosato@linux.ibm.com>
> Fixes: 4ec6054e7321 ("s390/pci: Report PCI error recovery results via SCLP")
> Cc:stable@vger.kernel.org
> Signed-off-by: Niklas Schnelle<schnelle@linux.ibm.com>
> ---
>   arch/s390/pci/pci_report.c | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Farhan Ali<alifm@linux.ibm.com>