public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] power: sequencing: pcie-m2: Fix device node reference leak in probe
@ 2026-03-02 14:31 Felix Gu
  2026-03-04  8:16 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-03-02 14:31 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Bartosz Golaszewski
  Cc: Bartosz Golaszewski, Manivannan Sadhasivam, linux-pci, linux-pm,
	linux-kernel, Felix Gu

In pwrseq_pcie_m2_probe(), ctx->of_node acquires an explicit reference
to the device node using of_node_get(), but there is no corresponding
of_node_put() in the driver's error handling paths or removal.

Since the ctx is tied to the lifecycle of the platform device, there
is no need to hold an additional reference to the device's own of_node.

Fixes: 52e7b5bd62ba ("power: sequencing: Add the Power Sequencing driver for the PCIe M.2 connectors")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/power/sequencing/pwrseq-pcie-m2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/sequencing/pwrseq-pcie-m2.c b/drivers/power/sequencing/pwrseq-pcie-m2.c
index d31a7dd8b35c..dadb4aad9d5d 100644
--- a/drivers/power/sequencing/pwrseq-pcie-m2.c
+++ b/drivers/power/sequencing/pwrseq-pcie-m2.c
@@ -109,7 +109,7 @@ static int pwrseq_pcie_m2_probe(struct platform_device *pdev)
 	if (!ctx)
 		return -ENOMEM;
 
-	ctx->of_node = of_node_get(dev->of_node);
+	ctx->of_node = dev_of_node(dev);
 	ctx->pdata = device_get_match_data(dev);
 	if (!ctx->pdata)
 		return dev_err_probe(dev, -ENODEV,

---
base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31
change-id: 20260302-m2-f638d393632e

Best regards,
-- 
Felix Gu <ustc.gu@gmail.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: sequencing: pcie-m2: Fix device node reference leak in probe
  2026-03-02 14:31 [PATCH] power: sequencing: pcie-m2: Fix device node reference leak in probe Felix Gu
@ 2026-03-04  8:16 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2026-03-04  8:16 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Bartosz Golaszewski, Felix Gu
  Cc: Bartosz Golaszewski, Manivannan Sadhasivam, linux-pci, linux-pm,
	linux-kernel


On Mon, 02 Mar 2026 22:31:44 +0800, Felix Gu wrote:
> In pwrseq_pcie_m2_probe(), ctx->of_node acquires an explicit reference
> to the device node using of_node_get(), but there is no corresponding
> of_node_put() in the driver's error handling paths or removal.
> 
> Since the ctx is tied to the lifecycle of the platform device, there
> is no need to hold an additional reference to the device's own of_node.
> 
> [...]

Applied, thanks!

[1/1] power: sequencing: pcie-m2: Fix device node reference leak in probe
      https://git.kernel.org/brgl/c/5c3daa5301693d2e5364483a3405649a0fdaed98

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-04  8:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 14:31 [PATCH] power: sequencing: pcie-m2: Fix device node reference leak in probe Felix Gu
2026-03-04  8:16 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox