Skip to content

Commit

Permalink
spi: tegra114: Add missing IRQ check in tegra_spi_probe
Browse files Browse the repository at this point in the history
[ Upstream commit 4f92724 ]

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: f333a33 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yuuoniy authored and gregkh committed Apr 8, 2022
1 parent a1bf728 commit 71727d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/spi/spi-tegra114.c
Expand Up @@ -1352,6 +1352,10 @@ static int tegra_spi_probe(struct platform_device *pdev)
tspi->phys = r->start;

spi_irq = platform_get_irq(pdev, 0);
if (spi_irq < 0) {
ret = spi_irq;
goto exit_free_master;
}
tspi->irq = spi_irq;

tspi->clk = devm_clk_get(&pdev->dev, "spi");
Expand Down

0 comments on commit 71727d4

Please sign in to comment.