From: Dan Carpenter Date: Mon, 17 Feb 2025 07:32:44 +0000 (+0300) Subject: ASoC: SOF: imx: Fix an IS_ERR() vs NULL bug in imx_parse_ioremap_memory() X-Git-Tag: io_uring-6.15-20250403~95^2~4^2~107 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=b20be2c77ce5341ded1a2d8aec119f6dca8ef1ad;p=linux-block.git ASoC: SOF: imx: Fix an IS_ERR() vs NULL bug in imx_parse_ioremap_memory() The devm_ioremap() function doesn't return error pointers, it returns NULL on error. Update the checking to match. Fixes: 651e0ed391b1 ("ASoC: SOF: imx: introduce more common structures and functions") Signed-off-by: Dan Carpenter Link: https://patch.msgid.link/68973636-eab8-4d82-8359-ae2c8f60f261@stanley.mountain Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/imx/imx-common.c b/sound/soc/sof/imx/imx-common.c index c3594815e60e..ea4651a0995c 100644 --- a/sound/soc/sof/imx/imx-common.c +++ b/sound/soc/sof/imx/imx-common.c @@ -338,9 +338,9 @@ static int imx_parse_ioremap_memory(struct snd_sof_dev *sdev) } sdev->bar[blk_type] = devm_ioremap(sdev->dev, base, size); - if (IS_ERR(sdev->bar[blk_type])) + if (!sdev->bar[blk_type]) return dev_err_probe(sdev->dev, - PTR_ERR(sdev->bar[blk_type]), + -ENOMEM, "failed to ioremap %s region\n", chip_info->memory[i].name); }