Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: tegra114: Add missing IRQ check in tegra_spi_probe

This func misses checking for platform_get_irq()'s call and may passes the
negative error codes to request_threaded_irq(), which takes unsigned IRQ #,
causing it to fail with -EINVAL, overriding an original error code.
Stop calling request_threaded_irq() with invalid IRQ #s.

Fixes: f333a331adfa ("spi/tegra114: add spi driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220128165238.25615-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Miaoqian Lin and committed by
Mark Brown
4f92724d d08de025

+4
+4
drivers/spi/spi-tegra114.c
··· 1352 1352 tspi->phys = r->start; 1353 1353 1354 1354 spi_irq = platform_get_irq(pdev, 0); 1355 + if (spi_irq < 0) { 1356 + ret = spi_irq; 1357 + goto exit_free_master; 1358 + } 1355 1359 tspi->irq = spi_irq; 1356 1360 1357 1361 tspi->clk = devm_clk_get(&pdev->dev, "spi");