public inbox for imx@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] remoteproc: imx_rproc: Fix NULL vs IS_ERR() bug in imx_rproc_addr_init()
@ 2026-02-27  9:15 Chen Ni
  2026-03-02  9:42 ` Peng Fan
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Ni @ 2026-02-27  9:15 UTC (permalink / raw)
  To: andersson, mathieu.poirier
  Cc: robh, Frank.Li, s.hauer, linux-remoteproc, imx, Chen Ni

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: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/remoteproc/imx_rproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index d33d1e2c41a4..0dd80e688b0e 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -812,7 +812,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
 
 		/* Not use resource version, because we might share region */
 		priv->mem[b].cpu_addr = devm_ioremap_resource_wc(&pdev->dev, &res);
-		if (!priv->mem[b].cpu_addr) {
+		if (IS_ERR(priv->mem[b].cpu_addr)) {
 			dev_err(dev, "failed to remap %pr\n", &res);
 			return -ENOMEM;
 		}
-- 
2.25.1


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

* Re: [PATCH] remoteproc: imx_rproc: Fix NULL vs IS_ERR() bug in imx_rproc_addr_init()
  2026-02-27  9:15 [PATCH] remoteproc: imx_rproc: Fix NULL vs IS_ERR() bug in imx_rproc_addr_init() Chen Ni
@ 2026-03-02  9:42 ` Peng Fan
  0 siblings, 0 replies; 2+ messages in thread
From: Peng Fan @ 2026-03-02  9:42 UTC (permalink / raw)
  To: Chen Ni
  Cc: andersson, mathieu.poirier, robh, Frank.Li, s.hauer,
	linux-remoteproc, imx

On Fri, Feb 27, 2026 at 05:15:46PM +0800, Chen Ni wrote:
>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: Chen Ni <nichen@iscas.ac.cn>

Reviewed-by: Peng Fan <peng.fan@nxp.com>

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

end of thread, other threads:[~2026-03-02  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27  9:15 [PATCH] remoteproc: imx_rproc: Fix NULL vs IS_ERR() bug in imx_rproc_addr_init() Chen Ni
2026-03-02  9:42 ` Peng Fan

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