diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2021-02-24 01:38:03 +0000 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-02-25 10:29:13 +0100 |
commit | c88fb897c1fb5a590dc6353ac4b01c8f46a347b3 (patch) | |
tree | be4ff9ce88e52f0739789be18378c342613f3e89 /sound | |
parent | 10e2ec8edece2566b40f69bae035a555ece71ab4 (diff) | |
download | linux-stable-c88fb897c1fb5a590dc6353ac4b01c8f46a347b3.tar.gz linux-stable-c88fb897c1fb5a590dc6353ac4b01c8f46a347b3.tar.bz2 linux-stable-c88fb897c1fb5a590dc6353ac4b01c8f46a347b3.zip |
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: 1448f8acf4cc ("sound: Add n64 driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Lauri Kasanen <cand@gmx.com>
Link: https://lore.kernel.org/r/20210224013803.2146953-1-weiyongjun1@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mips/snd-n64.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/mips/snd-n64.c b/sound/mips/snd-n64.c index ca6b4b99da98..e35e93157755 100644 --- a/sound/mips/snd-n64.c +++ b/sound/mips/snd-n64.c @@ -312,14 +312,14 @@ static int __init n64audio_probe(struct platform_device *pdev) } priv->mi_reg_base = devm_platform_ioremap_resource(pdev, 0); - if (!priv->mi_reg_base) { - err = -EINVAL; + if (IS_ERR(priv->mi_reg_base)) { + err = PTR_ERR(priv->mi_reg_base); goto fail_dma_alloc; } priv->ai_reg_base = devm_platform_ioremap_resource(pdev, 1); - if (!priv->ai_reg_base) { - err = -EINVAL; + if (IS_ERR(priv->ai_reg_base)) { + err = PTR_ERR(priv->ai_reg_base); goto fail_dma_alloc; } |