Skip to content

Commit

Permalink
ALSA: arm: pxa: pxa2xx-ac97-lib: fix return value check of platform_g…
Browse files Browse the repository at this point in the history
…et_irq()

platform_get_irq() returns negative error number on failure, fix the
return value check in pxa2xx_ac97_hw_probe() and assign the error code
to 'ret'.

Fixes: 2548e6c ("ARM: pxa: pxa2xx-ac97-lib: use IRQ resource")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221029082001.3207380-1-yangyingliang@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Yang Yingliang authored and Takashi Iwai committed Oct 29, 2022
1 parent 8d06679 commit 46cf195
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/arm/pxa2xx-ac97-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,10 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)
goto err_clk2;

irq = platform_get_irq(dev, 0);
if (!irq)
if (irq < 0) {
ret = irq;
goto err_irq;
}

ret = request_irq(irq, pxa2xx_ac97_irq, 0, "AC97", NULL);
if (ret < 0)
Expand Down

0 comments on commit 46cf195

Please sign in to comment.