[PATCH 09/10] EDAC/altera: Detach sb_irq handler when db_irq setup fails
From: Dinh Nguyen
Date: Mon Jul 27 2026 - 09:50:31 EST
altr_edac_a10_probe() installs the sb_irq chained handler before fetching
db_irq. If platform_get_irq() for db_irq fails, the probe returned
without detaching the sb_irq handler, leaving it pointing at the
devm-freed edac struct. Unlink the sb_irq chained handler before
removing the IRQ domain and returning.
Assisted-by: Cursor:claude-4.8-opus
Fixes: d5fc9125566c ("EDAC, altera: Combine Stratix10 and Arria10 probe functions")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Dinh Nguyen <dinguyen@xxxxxxxxxx>
---
drivers/edac/altera_edac.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 5087aa5ae5612..80ca9f511ac98 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -2209,6 +2209,8 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
} else {
edac->db_irq = platform_get_irq(pdev, 1);
if (edac->db_irq < 0) {
+ irq_set_chained_handler_and_data(edac->sb_irq,
+ NULL, NULL);
irq_domain_remove(edac->domain);
return edac->db_irq;
}
--
2.42.0.411.g813d9a9188