summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-tegra20-sflash.c
diff options
context:
space:
mode:
authorZhang Shurong <zhang_shurong@foxmail.com>2023-07-22 18:49:09 +0300
committerMark Brown <broonie@kernel.org>2023-07-26 18:30:19 +0300
commit29a449e765ff70a5bd533be94babb6d36985d096 (patch)
tree01b522c3a22123f530dc22e1347d9243f893a024 /drivers/spi/spi-tegra20-sflash.c
parent7ad1c439fb25907dba31af5d66b44c6a3b999c89 (diff)
downloadlinux-29a449e765ff70a5bd533be94babb6d36985d096.tar.xz
spi: tegra20-sflash: fix to check return value of platform_get_irq() in tegra_sflash_probe()
The platform_get_irq might be failed and return a negative result. So there should have an error handling code. Fixed this by adding an error handling code. Fixes: 8528547bcc33 ("spi: tegra: add spi driver for sflash controller") Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com> Link: https://lore.kernel.org/r/tencent_71FC162D589E4788C2152AAC84CD8D5C6D06@qq.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-tegra20-sflash.c')
-rw-r--r--drivers/spi/spi-tegra20-sflash.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
index 4286310628a2..0c5507473f97 100644
--- a/drivers/spi/spi-tegra20-sflash.c
+++ b/drivers/spi/spi-tegra20-sflash.c
@@ -455,7 +455,11 @@ static int tegra_sflash_probe(struct platform_device *pdev)
goto exit_free_master;
}
- tsd->irq = platform_get_irq(pdev, 0);
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
+ goto exit_free_master;
+ tsd->irq = ret;
+
ret = request_irq(tsd->irq, tegra_sflash_isr, 0,
dev_name(&pdev->dev), tsd);
if (ret < 0) {