mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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: 67a7bc7f03 ("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>
This commit is contained in:
committed by
Mathieu Poirier
parent
ac82dbc539
commit
099a60cca1
@@ -710,9 +710,9 @@ static int imx_dsp_rproc_add_carveout(struct imx_dsp_rproc *priv)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
cpu_addr = devm_ioremap_resource_wc(dev, &res);
|
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);
|
dev_err(dev, "failed to map memory %pR\n", &res);
|
||||||
return -ENOMEM;
|
return PTR_ERR(cpu_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Register memory region */
|
/* Register memory region */
|
||||||
|
|||||||
Reference in New Issue
Block a user