ARM Sunxi Platform Development
 help / color / mirror / Atom feed
* [PATCH] pmdomain: sunxi: pck600: Initialize pd->pck in probe
@ 2026-11-27  8:06 Alastair D'Silva
  2026-11-28 17:25 ` Jernej Škrabec
  0 siblings, 1 reply; 2+ messages in thread
From: Alastair D'Silva @ 2026-11-27  8:06 UTC (permalink / raw)
  To: Ulf Hansson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: linux-pm, linux-arm-kernel, linux-sunxi, Alastair D'Silva

sunxi_pck600_pd_set_power() dereferences pd->pck->dev on timeout.
sunxi_pck600_probe() never sets pd->pck, causing a NULL dereference.

Assign pd->pck = pck during probe.

Fixes: 76e4310115ca ("pmdomain: sunxi: add driver for Allwinner A523's PCK-600 power controller")
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 drivers/pmdomain/sunxi/sun55i-pck600.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pmdomain/sunxi/sun55i-pck600.c b/drivers/pmdomain/sunxi/sun55i-pck600.c
index 81c3b18a38a4..46632278b8f4 100644
--- a/drivers/pmdomain/sunxi/sun55i-pck600.c
+++ b/drivers/pmdomain/sunxi/sun55i-pck600.c
@@ -175,6 +175,7 @@ static int sunxi_pck600_probe(struct platform_device *pdev)
 		pd->genpd.power_off = sunxi_pck600_power_off;
 		pd->genpd.power_on = sunxi_pck600_power_on;
 		pd->genpd.flags = pd_desc->flags;
+		pd->pck = pck;
 		pd->base = base + PPU_REG_SIZE * i;
 
 		sunxi_pck600_pd_setup(pd, desc);
-- 
2.53.0


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

end of thread, other threads:[~2026-11-28 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27  8:06 [PATCH] pmdomain: sunxi: pck600: Initialize pd->pck in probe Alastair D'Silva
2026-11-28 17:25 ` Jernej Škrabec

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