Skip to content

Commit

Permalink
ALSA: hda: Add IRQ check for platform_get_irq()
Browse files Browse the repository at this point in the history
[ Upstream commit 8c13212443230d03ff25014514ec0d53498c0912 ]

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: Jiajun Cao <[email protected]>
Signed-off-by: Xin Tan <[email protected]>
Reviewed-by: Thierry Reding <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
caojiajunss authored and somestupidgirl committed Jan 26, 2025
1 parent 441279d commit 0614f2b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/pci/hda/hda_tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev)
unsigned short gcap;
int irq_id = platform_get_irq(pdev, 0);

if (irq_id < 0)
return irq_id;

err = hda_tegra_init_chip(chip, pdev);
if (err)
return err;
Expand Down

0 comments on commit 0614f2b

Please sign in to comment.