[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220128164741.23846-1-linmq006@gmail.com>
Date: Fri, 28 Jan 2022 16:47:41 +0000
From: Miaoqian Lin <linmq006@...il.com>
To: Laxman Dewangan <ldewangan@...dia.com>,
Mark Brown <broonie@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Stephen Warren <swarren@...dia.com>, linux-spi@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: linmq006@...il.com
Subject: [PATCH v3] spi: tegra20: Fix missing IRQ check in tegra_slink_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: dc4dc3605639 ("spi: tegra: add spi driver for SLINK controller")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
Changes in v2:
- fix wrong func name in commit message.
Changes in v3:
- fix Fixes tag info.
- remove redundant error message.
---
drivers/spi/spi-tegra20-slink.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index 2a03739a0c60..f8661963ecba 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -1100,6 +1100,10 @@ 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) {
+ ret = spi_irq;
+ goto exit_pm_put;
+ }
tspi->irq = spi_irq;
ret = request_threaded_irq(tspi->irq, tegra_slink_isr,
tegra_slink_isr_thread, IRQF_ONESHOT,
--
2.17.1
Powered by blists - more mailing lists