From b20be2c77ce5341ded1a2d8aec119f6dca8ef1ad Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 17 Feb 2025 10:32:44 +0300 Subject: [PATCH] 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 --- sound/soc/sof/imx/imx-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/imx/imx-common.c b/sound/soc/sof/imx/imx-common.c index c3594815e60e8..ea4651a0995c0 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); } -- 2.50.1