[PATCH] memory: fsl_ifc: guard optional NAND IRQ cleanup
From: Runyu Xiao
Date: Fri Oct 09 2026 - 02:06:31 EST
The IFC device tree binding permits a controller to provide only the
common interrupt. In that configuration, irq_of_parse_and_map() returns
0 for the optional NAND IRQ and probe skips request_irq(), but both the
probe unwind and remove paths still call free_irq() unconditionally.
Guard the NAND IRQ cleanup with a check for a non-zero IRQ.
Fixes: 721c0705906e ("powerpc/mpc85xx: Update interrupt handling for IFC controller")
Cc: stable@xxxxxxxxxxxxxxx
Assisted-by: LLM
Signed-off-by: Runyu Xiao <runyu.xiao@xxxxxxxxxx>
---
drivers/memory/fsl_ifc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c
index e89e0c6cc4..6dcc317d95 100644
--- a/drivers/memory/fsl_ifc.c
+++ b/drivers/memory/fsl_ifc.c
@@ -89,7 +89,8 @@ static void fsl_ifc_ctrl_remove(struct platform_device *dev)
struct fsl_ifc_ctrl *ctrl = dev_get_drvdata(&dev->dev);
of_platform_depopulate(&dev->dev);
- free_irq(ctrl->nand_irq, ctrl);
+ if (ctrl->nand_irq)
+ free_irq(ctrl->nand_irq, ctrl);
free_irq(ctrl->irq, ctrl);
irq_dispose_mapping(ctrl->nand_irq);
@@ -292,7 +293,8 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
return 0;
err_free_nandirq:
- free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
+ if (fsl_ifc_ctrl_dev->nand_irq)
+ free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
err_free_irq:
free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
err_unmap_nandirq: