[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250721153609.8611-4-johan+linaro@kernel.org>
Date: Mon, 21 Jul 2025 17:36:09 +0200
From: Johan Hovold <johan+linaro@...nel.org>
To: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Manivannan Sadhasivam <mani@...nel.org>,
linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
Johan Hovold <johan+linaro@...nel.org>,
stable@...r.kernel.org
Subject: [PATCH 3/3] PCI/pwrctrl: Fix device leak at device stop
Make sure to drop the reference to the pwrctrl device taken by
of_find_device_by_node() when stopping a PCI device.
Fixes: 681725afb6b9 ("PCI/pwrctl: Remove pwrctl device without iterating over all children of pwrctl parent")
Cc: stable@...r.kernel.org # 6.13
Cc: Manivannan Sadhasivam <mani@...nel.org>
Signed-off-by: Johan Hovold <johan+linaro@...nel.org>
---
drivers/pci/remove.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index 445afdfa6498..16f21edbc29d 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -31,6 +31,8 @@ static void pci_pwrctrl_unregister(struct device *dev)
return;
of_device_unregister(pdev);
+ put_device(&pdev->dev);
+
of_node_clear_flag(np, OF_POPULATED);
}
--
2.49.1
Powered by blists - more mailing lists