From: Slavin Liu <bolin.liu@seu.edu.cn>
To: ulfh@kernel.org, frank.li@nxp.com, s.hauer@pengutronix.de
Cc: kernel@pengutronix.de, festevam@gmail.com,
linux-pm@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, bolin.liu@seu.edu.cn
Subject: [PATCH RFC] pmdomain: imx: reject a missing bus power domain
Date: Fri, 11 Sep 2026 14:09:29 +0800 [thread overview]
Message-ID: <20260911060929.94481-1-bolin.liu@seu.edu.cn> (raw)
The named-domain attach API may return NULL for an absent name.
Treat that as -ENODEV before publishing bus_power_dev to later unwind
paths, without changing the handling of existing error pointers.
Detected by static analysis and reviewed with AI-assisted source auditing.
Fixes: 2684ac05a8c4 ("soc: imx: add i.MX8M blk-ctrl driver")
Fixes: 556f5cf9568a ("soc: imx: add i.MX8MP HSIO blk-ctrl")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
---
drivers/pmdomain/imx/imx8m-blk-ctrl.c | 2 ++
drivers/pmdomain/imx/imx8mp-blk-ctrl.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/drivers/pmdomain/imx/imx8m-blk-ctrl.c b/drivers/pmdomain/imx/imx8m-blk-ctrl.c
index 479789009c7f..9653a8ac9a6e 100644
--- a/drivers/pmdomain/imx/imx8m-blk-ctrl.c
+++ b/drivers/pmdomain/imx/imx8m-blk-ctrl.c
@@ -228,6 +228,8 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
return -ENOMEM;
bc->bus_power_dev = dev_pm_domain_attach_by_name(dev, "bus");
+ if (!bc->bus_power_dev)
+ return dev_err_probe(dev, -ENODEV, "missing bus power domain\n");
if (IS_ERR(bc->bus_power_dev)) {
if (PTR_ERR(bc->bus_power_dev) == -ENODEV)
return dev_err_probe(dev, -EPROBE_DEFER,
diff --git a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
index d255c20f58e2..e952b4ee75c0 100644
--- a/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
+++ b/drivers/pmdomain/imx/imx8mp-blk-ctrl.c
@@ -655,6 +655,8 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
return -ENOMEM;
bc->bus_power_dev = dev_pm_domain_attach_by_name(dev, "bus");
+ if (!bc->bus_power_dev)
+ return dev_err_probe(dev, -ENODEV, "missing bus power domain\n");
if (IS_ERR(bc->bus_power_dev))
return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev),
"failed to attach bus power domain\n");
next reply other threads:[~2026-09-11 6:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 6:09 Slavin Liu [this message]
2026-09-11 15:01 ` [PATCH RFC] pmdomain: imx: reject a missing bus power domain Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260911060929.94481-1-bolin.liu@seu.edu.cn \
--to=bolin.liu@seu.edu.cn \
--cc=festevam@gmail.com \
--cc=frank.li@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=ulfh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox