Skip to content

Commit

Permalink
spi: tegra20-sflash: fix to check return value of platform_get_irq() …
Browse files Browse the repository at this point in the history
…in tegra_sflash_probe()

[ Upstream commit 29a449e ]

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: 8528547 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ZhangShurong authored and gregkh committed Sep 13, 2023
1 parent f5f7aa2 commit ce60bfc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/spi/spi-tegra20-sflash.c
Expand Up @@ -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) {
Expand Down

0 comments on commit ce60bfc

Please sign in to comment.