[PATCH] EDAC/altera: Check device IRQ lookup results
From: Alex Guo
Date: Sun Nov 15 2026 - 01:45:31 EST
altr_edac_device_probe() passes the single-bit and double-bit IRQ lookup
results directly to devm_request_irq(). If either lookup fails, the
request can mask the original error, including -EPROBE_DEFER.
Check both results and preserve the lookup error when unwinding the
probe.
A similar issue was fixed in commit 47c3e06ed95a
("spi: tegra210-quad: Fix missin IRQ check in tegra_qspi_probe").
Fixes: c3eea1942a16 ("EDAC, altera: Add Altera L2 cache and OCRAM support")
Signed-off-by: Alex Guo <alexguo1023@xxxxxxxxx>
---
Build-tested the affected driver object with Clang 18 for arm.
No hardware test was performed.
drivers/edac/altera_edac.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 12175d0cbc43..b7f04cccb599 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -759,6 +759,11 @@ static int altr_edac_device_probe(struct
platform_device *pdev)
}
drvdata->sb_irq = platform_get_irq(pdev, 0);
+ if (drvdata->sb_irq < 0) {
+ res = drvdata->sb_irq;
+ goto fail1;
+ }
+
res = devm_request_irq(&pdev->dev, drvdata->sb_irq,
altr_edac_device_handler,
0, dev_name(&pdev->dev), dci);
@@ -766,6 +771,11 @@ static int altr_edac_device_probe(struct
platform_device *pdev)
goto fail1;
drvdata->db_irq = platform_get_irq(pdev, 1);
+ if (drvdata->db_irq < 0) {
+ res = drvdata->db_irq;
+ goto fail1;
+ }
+
res = devm_request_irq(&pdev->dev, drvdata->db_irq,
altr_edac_device_handler,
0, dev_name(&pdev->dev), dci);
--
2.43.0