From: Chen Ni Date: Fri, 27 Feb 2026 09:21:10 +0000 (+0800) Subject: remoteproc: k3: Fix NULL vs IS_ERR() bug in k3_reserved_mem_init() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b1f4b5c72cc40e676293b8609cacef7e1545beb;p=thirdparty%2Fkernel%2Flinux.git remoteproc: k3: Fix NULL vs IS_ERR() bug in k3_reserved_mem_init() 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 Reviewed-by: Peng Fan Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20260227092110.4044313-1-nichen@iscas.ac.cn Signed-off-by: Mathieu Poirier --- diff --git a/drivers/remoteproc/ti_k3_common.c b/drivers/remoteproc/ti_k3_common.c index 32aa954dc5be6..3cb8ae5d72f67 100644 --- a/drivers/remoteproc/ti_k3_common.c +++ b/drivers/remoteproc/ti_k3_common.c @@ -513,7 +513,7 @@ int k3_reserved_mem_init(struct k3_rproc *kproc) kproc->rmem[i].dev_addr = (u32)res.start; kproc->rmem[i].size = resource_size(&res); kproc->rmem[i].cpu_addr = devm_ioremap_resource_wc(dev, &res); - if (!kproc->rmem[i].cpu_addr) { + if (IS_ERR(kproc->rmem[i].cpu_addr)) { dev_err(dev, "failed to map reserved memory#%d at %pR\n", i + 1, &res); return -ENOMEM;