diff mbox series

spi: tegra20-sflash: Fix signedness bug in tegra_sflash_probe

Message ID tencent_4D4974DE0CD4266C25819179B42888A3E20A@qq.com
State New
Headers show
Series spi: tegra20-sflash: Fix signedness bug in tegra_sflash_probe | expand

Commit Message

Zhang Shurong July 15, 2023, 9:53 a.m. UTC
The "tsd->irq" variable is unsigned so this error handling
code will not work.

Fix this by adding error handling statement

Fixes: 8528547bcc33 ("spi: tegra: add spi driver for sflash controller")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
---
 drivers/spi/spi-tegra20-sflash.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
index 4286310628a2..4c18337de813 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) {