Skip to content

Commit 393151c

Browse files
Wei Yongjunbroonie
authored andcommitted
ASoC: SOF: imx8: Fix return value check in imx8_probe()
In case of error, the function devm_ioremap_wc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 202acc5 ("ASoC: SOF: imx: Add i.MX8 HW support") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20190826120003.183279-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3cdc3c9 commit 393151c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎sound/soc/sof/imx/imx8.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ static int imx8_probe(struct snd_sof_dev *sdev)
296296
sdev->bar[SOF_FW_BLK_TYPE_SRAM] = devm_ioremap_wc(sdev->dev, res.start,
297297
res.end - res.start +
298298
1);
299-
if (IS_ERR(sdev->bar[SOF_FW_BLK_TYPE_SRAM])) {
299+
if (!sdev->bar[SOF_FW_BLK_TYPE_SRAM]) {
300300
dev_err(sdev->dev, "failed to ioremap mem 0x%x size 0x%x\n",
301301
base, size);
302-
ret = PTR_ERR(sdev->bar[SOF_FW_BLK_TYPE_SRAM]);
302+
ret = -ENOMEM;
303303
goto exit_pdev_unregister;
304304
}
305305
sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM;

0 commit comments

Comments
 (0)