提交 447852de 编写于 作者: M Miaoqian Lin 提交者: Zheng Zengkai

spi: tegra114: Add missing IRQ check in tegra_spi_probe

stable inclusion
from stable-v5.10.110
commit 99a8dfce7c0b9c2e3c2c4b4989bd2870da6b1598
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=99a8dfce7c0b9c2e3c2c4b4989bd2870da6b1598

--------------------------------

[ Upstream commit 4f92724d ]

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: f333a331 ("spi/tegra114: add spi driver")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220128165238.25615-1-linmq006@gmail.comSigned-off-by: NMark Brown <broonie@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 5a803902
...@@ -1353,6 +1353,10 @@ static int tegra_spi_probe(struct platform_device *pdev) ...@@ -1353,6 +1353,10 @@ static int tegra_spi_probe(struct platform_device *pdev)
tspi->phys = r->start; tspi->phys = r->start;
spi_irq = platform_get_irq(pdev, 0); spi_irq = platform_get_irq(pdev, 0);
if (spi_irq < 0) {
ret = spi_irq;
goto exit_free_master;
}
tspi->irq = spi_irq; tspi->irq = spi_irq;
tspi->clk = devm_clk_get(&pdev->dev, "spi"); tspi->clk = devm_clk_get(&pdev->dev, "spi");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册