Skip to content

Commit

Permalink
spi: tegra210-quad: Fix missin IRQ check in tegra_qspi_probe
Browse files Browse the repository at this point in the history
[ Upstream commit 47c3e06 ]

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: 921fc18 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220128165956.27821-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 71727d4 commit 629153e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/spi/spi-tegra210-quad.c
Expand Up @@ -1240,6 +1240,8 @@ static int tegra_qspi_probe(struct platform_device *pdev)

tqspi->phys = r->start;
qspi_irq = platform_get_irq(pdev, 0);
if (qspi_irq < 0)
return qspi_irq;
tqspi->irq = qspi_irq;

tqspi->clk = devm_clk_get(&pdev->dev, "qspi");
Expand Down

0 comments on commit 629153e

Please sign in to comment.