Skip to content

Commit

Permalink
mtd: rawnand: tegra: add missing check for platform_get_irq()
Browse files Browse the repository at this point in the history
[ Upstream commit 0a1166c ]

Add the missing check for platform_get_irq() and return error code
if it fails.

Fixes: d7d9f8e ("mtd: rawnand: add NVIDIA Tegra NAND Flash controller driver")
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230821084046.217025-1-yiyang13@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yi Yang authored and gregkh committed Nov 28, 2023
1 parent c19a879 commit e651a07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mtd/nand/raw/tegra_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,10 @@ static int tegra_nand_probe(struct platform_device *pdev)
init_completion(&ctrl->dma_complete);

ctrl->irq = platform_get_irq(pdev, 0);
if (ctrl->irq < 0) {
err = ctrl->irq;
goto err_put_pm;
}
err = devm_request_irq(&pdev->dev, ctrl->irq, tegra_nand_irq, 0,
dev_name(&pdev->dev), ctrl);
if (err) {
Expand Down

0 comments on commit e651a07

Please sign in to comment.