Commit 37108ef4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

ASoC: amd: fix an IS_ERR() vs NULL bug in probe

The devm_ioremap() function returns NULL on error, it doesn't return
error pointers.

Fixes: e550339e ("ASoC: amd: add vangogh i2s controller driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210727081756.GA19121@kiliSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 89d751d8
......@@ -399,8 +399,8 @@ static int acp5x_dai_probe(struct platform_device *pdev)
}
adata->acp5x_base = devm_ioremap(&pdev->dev, res->start,
resource_size(res));
if (IS_ERR(adata->acp5x_base))
return PTR_ERR(adata->acp5x_base);
if (!adata->acp5x_base)
return -ENOMEM;
adata->master_mode = I2S_MASTER_MODE_ENABLE;
dev_set_drvdata(&pdev->dev, adata);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment