Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: rawnand: tegra: add missing check for platform_get_irq()

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

Fixes: d7d9f8ec77fe ("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

authored by

Yi Yang and committed by
Miquel Raynal
0a1166c2 0bb80ecc

+4
+4
drivers/mtd/nand/raw/tegra_nand.c
··· 1197 1197 init_completion(&ctrl->dma_complete); 1198 1198 1199 1199 ctrl->irq = platform_get_irq(pdev, 0); 1200 + if (ctrl->irq < 0) { 1201 + err = ctrl->irq; 1202 + goto err_put_pm; 1203 + } 1200 1204 err = devm_request_irq(&pdev->dev, ctrl->irq, tegra_nand_irq, 0, 1201 1205 dev_name(&pdev->dev), ctrl); 1202 1206 if (err) {