Skip to content

Commit

Permalink
spi: tegra: Fix missing IRQ check in tegra_slink_probe()
Browse files Browse the repository at this point in the history
This func misses checking for platform_get_irq()'s call and may passes the
negative error codes to request_irq(), which takes unsigned IRQ #,
causing it to fail with -EINVAL, overriding an original error code.

Fix this by stop calling request_irq() with invalid IRQ #s.

Fixes: dc4dc36 ("spi: tegra: add spi driver for SLINK controller")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Link: https://lore.kernel.org/r/tencent_73FCC06A3D1C14EE5175253C6FB46A07B709@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Zhang Shurong authored and Mark Brown committed Sep 11, 2023
1 parent 2d98bda commit eb9913b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/spi/spi-tegra20-slink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,8 @@ static int tegra_slink_probe(struct platform_device *pdev)
reset_control_deassert(tspi->rst);

spi_irq = platform_get_irq(pdev, 0);
if (spi_irq < 0)
return spi_irq;
tspi->irq = spi_irq;
ret = request_threaded_irq(tspi->irq, tegra_slink_isr,
tegra_slink_isr_thread, IRQF_ONESHOT,
Expand Down

0 comments on commit eb9913b

Please sign in to comment.