* [PATCH] pmdomain: imx: gpcv2: Take a reference to each PGC node
@ 2026-11-23 17:19 Yige Jiang
0 siblings, 0 replies; only message in thread
From: Yige Jiang @ 2026-11-23 17:19 UTC (permalink / raw)
To: Ulf Hansson, Frank Li
Cc: Yige Jiang, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
linux-pm, imx, linux-arm-kernel, linux-kernel, Sashiko
The child-node iterator owns the reference to each PGC node, but
imx_gpcv2_probe() assigns the node to a newly allocated platform device
without taking another reference. If platform_device_add() fails,
platform_device_put() releases the node through platform_device_release(),
and the iterator then drops the same reference again.
Use platform_device_set_of_node() to give the child device its own node
reference, paired with the put in platform_device_release().
Fixes: 03aa12629fc4 ("soc: imx: Add GPCv2 power gating driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/r/20260530004541.E04701F00898@smtp.kernel.org/
Signed-off-by: Yige Jiang <yigejiang86@gmail.com>
---
AI assistance was used for analysis and patch preparation.
Based on next-20261104 (8b7179210b22).
Compile-tested: arm64, GCC 14.2.0, W=1, drivers/pmdomain/imx/gpcv2.o;
baseline and patched objects built with no warnings.
Static source review; no hardware, boot, or KASAN test was performed.
drivers/pmdomain/imx/gpcv2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pmdomain/imx/gpcv2.c b/drivers/pmdomain/imx/gpcv2.c
index 6a54ee734514645db7e0628bdddcf579d1f0d904..7b377bf0196491298e9e772b97d15a2bda9ff83a 100644
--- a/drivers/pmdomain/imx/gpcv2.c
+++ b/drivers/pmdomain/imx/gpcv2.c
@@ -1513,7 +1513,7 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
domain->genpd.power_off = imx_pgc_power_down;
pd_pdev->dev.parent = dev;
- device_set_node(&pd_pdev->dev, of_fwnode_handle(np));
+ platform_device_set_of_node(pd_pdev, np);
ret = platform_device_add(pd_pdev);
if (ret) {
base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-23 17:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 17:19 [PATCH] pmdomain: imx: gpcv2: Take a reference to each PGC node Yige Jiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox