Skip to content

Commit

Permalink
ALSA: n64: Fix return value check in n64audio_probe()
Browse files Browse the repository at this point in the history
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: 1448f8a ("sound: Add n64 driver")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Lauri Kasanen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Wei Yongjun authored and tiwai committed Feb 25, 2021
1 parent 10e2ec8 commit c88fb89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sound/mips/snd-n64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c88fb89

Please sign in to comment.