linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: cirrus: cs42l43: Handle devm_pm_runtime_enable() errors
@ 2025-11-24  1:49 Haotian Zhang
  2025-11-24 11:56 ` Charles Keepax
  0 siblings, 1 reply; 2+ messages in thread
From: Haotian Zhang @ 2025-11-24  1:49 UTC (permalink / raw)
  To: ckeepax, rf, david.rhodes, linus.walleij
  Cc: linux-sound, patches, linux-gpio, linux-kernel, Haotian Zhang

devm_pm_runtime_enable() can fail due to memory allocation. The current
code ignores its return value, potentially causing pm_runtime_idle() to
operate on uninitialized runtime PM state.

Check the return value of devm_pm_runtime_enable() and return on failure.

Fixes: d5282a539297 ("pinctrl: cs42l43: Add support for the cs42l43")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
index 68abb6d6cecd..fdf7e95b17ea 100644
--- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
+++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
@@ -573,7 +573,9 @@ static int cs42l43_pin_probe(struct platform_device *pdev)
 
 	device_set_node(priv->dev, fwnode);
 
-	devm_pm_runtime_enable(priv->dev);
+	ret = devm_pm_runtime_enable(priv->dev);
+	if (ret)
+		return ret;
 	pm_runtime_idle(priv->dev);
 
 	pctldev = devm_pinctrl_register(priv->dev, &cs42l43_pin_desc, priv);
-- 
2.50.1.windows.1


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

end of thread, other threads:[~2025-11-24 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-24  1:49 [PATCH] pinctrl: cirrus: cs42l43: Handle devm_pm_runtime_enable() errors Haotian Zhang
2025-11-24 11:56 ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).