Skip to content

Commit 099a60c

Browse files
Dan Carpentermathieupoirier
authored andcommitted
remoteproc: imx_dsp_rproc: Fix NULL vs IS_ERR() bug in imx_dsp_rproc_add_carveout()
The devm_ioremap_resource_wc() function never returns NULL, it returns error pointers. Update the error checking to match. Fixes: 67a7bc7 ("remoteproc: Use of_reserved_mem_region_* functions for "memory-region"") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com> Link: https://lore.kernel.org/r/aSf6OerBbPcxBUVt@stanley.mountain Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent ac82dbc commit 099a60c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/remoteproc/imx_dsp_rproc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,9 +710,9 @@ static int imx_dsp_rproc_add_carveout(struct imx_dsp_rproc *priv)
710710
return -EINVAL;
711711

712712
cpu_addr = devm_ioremap_resource_wc(dev, &res);
713-
if (!cpu_addr) {
713+
if (IS_ERR(cpu_addr)) {
714714
dev_err(dev, "failed to map memory %pR\n", &res);
715-
return -ENOMEM;
715+
return PTR_ERR(cpu_addr);
716716
}
717717

718718
/* Register memory region */

0 commit comments

Comments
 (0)