From: Dan Carpenter <dan.carpenter@linaro•org>
To: Rob Herring <robh@kernel•org>
Cc: Bjorn Andersson <andersson@kernel•org>,
Mathieu Poirier <mathieu.poirier@linaro•org>,
Shawn Guo <shawnguo@kernel•org>,
Sascha Hauer <s.hauer@pengutronix•de>,
Pengutronix Kernel Team <kernel@pengutronix•de>,
Fabio Estevam <festevam@gmail•com>,
Geert Uytterhoeven <geert+renesas@glider•be>,
Arnaud Pouliquen <arnaud.pouliquen@foss•st.com>,
linux-remoteproc@vger•kernel.org, imx@lists•linux.dev,
linux-arm-kernel@lists•infradead.org,
linux-kernel@vger•kernel.org, kernel-janitors@vger•kernel.org
Subject: [PATCH next] remoteproc: imx_dsp_rproc: Fix NULL vs IS_ERR() bug in imx_dsp_rproc_add_carveout()
Date: Thu, 27 Nov 2025 10:14:01 +0300 [thread overview]
Message-ID: <aSf6OerBbPcxBUVt@stanley.mountain> (raw)
The devm_ioremap_resource_wc() function never returns NULL, it returns
error pointers. Update the error checking to match.
Fixes: 67a7bc7f0358 ("remoteproc: Use of_reserved_mem_region_* functions for "memory-region"")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro•org>
---
drivers/remoteproc/imx_dsp_rproc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
index be83b5f20f15..5130a35214c9 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -710,9 +710,9 @@ static int imx_dsp_rproc_add_carveout(struct imx_dsp_rproc *priv)
return -EINVAL;
cpu_addr = devm_ioremap_resource_wc(dev, &res);
- if (!cpu_addr) {
+ if (IS_ERR(cpu_addr)) {
dev_err(dev, "failed to map memory %pR\n", &res);
- return -ENOMEM;
+ return PTR_ERR(cpu_addr);
}
/* Register memory region */
--
2.51.0
next reply other threads:[~2025-11-27 7:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-27 7:14 Dan Carpenter [this message]
2025-11-27 7:48 ` [PATCH next] remoteproc: imx_dsp_rproc: Fix NULL vs IS_ERR() bug in imx_dsp_rproc_add_carveout() Iuliana Prodan
2025-11-27 16:02 ` Mathieu Poirier
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=aSf6OerBbPcxBUVt@stanley.mountain \
--to=dan.carpenter@linaro$(echo .)org \
--cc=andersson@kernel$(echo .)org \
--cc=arnaud.pouliquen@foss$(echo .)st.com \
--cc=festevam@gmail$(echo .)com \
--cc=geert+renesas@glider$(echo .)be \
--cc=imx@lists$(echo .)linux.dev \
--cc=kernel-janitors@vger$(echo .)kernel.org \
--cc=kernel@pengutronix$(echo .)de \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-remoteproc@vger$(echo .)kernel.org \
--cc=mathieu.poirier@linaro$(echo .)org \
--cc=robh@kernel$(echo .)org \
--cc=s.hauer@pengutronix$(echo .)de \
--cc=shawnguo@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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