提交 1e3fa3ca 编写于 作者: J Jiajun Cao 提交者: Yang Yingliang

ALSA: hda: Add IRQ check for platform_get_irq()

stable inclusion
from linux-4.19.198
commit a7970a03e3995e45f01a7dcc090a80f3a7968274

--------------------------------

[ Upstream commit 8c132124 ]

The function hda_tegra_first_init() neglects to check the return
value after executing platform_get_irq().

hda_tegra_first_init() should check the return value (if negative
error number) for errors so as to not pass a negative value to
the devm_request_irq().

Fix it by adding a check for the return value irq_id.
Signed-off-by: NJiajun Cao <jjcao20@fudan.edu.cn>
Signed-off-by: NXin Tan <tanxin.ctf@gmail.com>
Reviewed-by: NThierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210622131947.94346-1-jjcao20@fudan.edu.cnSigned-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 9eac31ac
...@@ -363,6 +363,9 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) ...@@ -363,6 +363,9 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev)
unsigned short gcap; unsigned short gcap;
int irq_id = platform_get_irq(pdev, 0); int irq_id = platform_get_irq(pdev, 0);
if (irq_id < 0)
return irq_id;
err = hda_tegra_init_chip(chip, pdev); err = hda_tegra_init_chip(chip, pdev);
if (err) if (err)
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册