Commit c88fb897 authored by Wei Yongjun's avatar Wei Yongjun Committed by Takashi Iwai

ALSA: n64: Fix return value check in n64audio_probe()

In case of error, the function devm_platform_ioremap_resource()
returns ERR_PTR() and never returns NULL. The NULL test in the
return value check should be replaced with IS_ERR().

Fixes: 1448f8ac ("sound: Add n64 driver")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarLauri Kasanen <cand@gmx.com>
Link: https://lore.kernel.org/r/20210224013803.2146953-1-weiyongjun1@huawei.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 10e2ec8e
...@@ -312,14 +312,14 @@ static int __init n64audio_probe(struct platform_device *pdev) ...@@ -312,14 +312,14 @@ static int __init n64audio_probe(struct platform_device *pdev)
} }
priv->mi_reg_base = devm_platform_ioremap_resource(pdev, 0); priv->mi_reg_base = devm_platform_ioremap_resource(pdev, 0);
if (!priv->mi_reg_base) { if (IS_ERR(priv->mi_reg_base)) {
err = -EINVAL; err = PTR_ERR(priv->mi_reg_base);
goto fail_dma_alloc; goto fail_dma_alloc;
} }
priv->ai_reg_base = devm_platform_ioremap_resource(pdev, 1); priv->ai_reg_base = devm_platform_ioremap_resource(pdev, 1);
if (!priv->ai_reg_base) { if (IS_ERR(priv->ai_reg_base)) {
err = -EINVAL; err = PTR_ERR(priv->ai_reg_base);
goto fail_dma_alloc; goto fail_dma_alloc;
} }
......
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