Skip to contentSkip to conversation

bus: brcmstb_gisb: Check required IRQ lookup results

PATCH Applied Alex Guo 2 participants 3 messages Nov 14 – Nov 19 Broadcom BCM7XXX Arm architecture

lore
Share & tools
lore

Alex Guo

author
#0 lore raw

PATCH 1/1 bus: brcmstb_gisb: Check required IRQ lookup results

platform_get_irq() can return a negative error code for the timeout or target abort interrupt. Passing it to devm_request_irq() can replace the lookup error with -EINVAL.

Check both lookup results and return the original error before requesting either interrupt.

A similar issue was fixed in commit 47c3e06ed95a
("spi: tegra210-quad: Fix missin IRQ check in tegra_qspi_probe").

Fixes 44127b771d9c ("bus: add Broadcom GISB bus arbiter timeout/error handler")

---
Build-tested the affected driver object with Clang 18 for ARM (multi_v7_defconfig). No hardware test was performed.

 drivers/bus/brcmstb_gisb.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/bus/brcmstb_gisb.c +0 -0
index 113a09e10328..c0dd2e3205ff 100644
@@ -419,7 +419,13 @@ static int __init brcmstb_gisb_arb_probe(struct

platform_device *pdev)

        int i, first, last;

        timeout_irq = platform_get_irq(pdev, 0);
+       if (timeout_irq < 0)
+               return timeout_irq;
+
        tea_irq = platform_get_irq(pdev, 1);
+       if (tea_irq < 0)
+               return tea_irq;
+
        bp_irq = platform_get_irq(pdev, 2);

        gdev = devm_kzalloc_obj(&pdev->dev, *gdev);

--
2.43.0

maintainer
#1 lore raw
Quoted 7 lines · Alex Guo

platform_get_irq() can return a negative error code for the timeout or target abort interrupt. Passing it to devm_request_irq() can replace the lookup error with -EINVAL.

Check both lookup results and return the original error before requesting either interrupt.

Quoted 8 lines

A similar issue was fixed in commit 47c3e06ed95a
("spi: tegra210-quad: Fix missin IRQ check in tegra_qspi_probe").

Fixes 44127b771d9c ("bus: add Broadcom GISB bus arbiter timeout/error handler")

---
Build-tested the affected driver object with Clang 18 for ARM (multi_v7_defconfig). No hardware test was performed.

The patch is correct but I am not sure which tree you applied this to because in my tree (drivers/next) we have not moved to devm_kzalloc_obj() yet.

Signature · 1 line
Florian
maintainer Applied
#2 lore raw
In reply to Alex Guo
Quoted 4 lines · Alex Guo

platform_get_irq() can return a negative error code for the timeout or target abort interrupt. Passing it to devm_request_irq() can replace the lookup error with -EINVAL.

Quoted 8 lines

Check both lookup results and return the original error before requesting either interrupt.

A similar issue was fixed in commit 47c3e06ed95a
("spi: tegra210-quad: Fix missin IRQ check in tegra_qspi_probe").

Fixes 44127b771d9c ("bus: add Broadcom GISB bus arbiter timeout/error handler")

Applied to drivers/next, thanks!

Signature · 1 line
Florian