[PATCH v2 6/8] irqchip/imx-intmux: Don't WARN on malformed interrupt specifiers
Peng Fan
peng.fan at linux.dev
Thu Dec 3 01:29:18 PST 2026
From: Peng Fan <peng.fan at nxp.com>
The xlate callback validates the interrupt specifier cells, but uses
WARN_ON() for checks that can be triggered by user-supplied device tree
data. A malformed specifier is an expected, recoverable error, so the
WARN only floods the log.
Return -EINVAL without the splat. Also reject source numbers beyond the
32 inputs of a channel instead of letting the association hit the WARN
in irq_domain_associate_locked().
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
drivers/irqchip/irq-imx-intmux.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-imx-intmux.c b/drivers/irqchip/irq-imx-intmux.c
index a9c554eba958..369132b4677b 100644
--- a/drivers/irqchip/irq-imx-intmux.c
+++ b/drivers/irqchip/irq-imx-intmux.c
@@ -145,10 +145,13 @@ static int imx_intmux_irq_xlate(struct irq_domain *d, struct device_node *node,
* the 1st cell: hw interrupt number
* the 2nd cell: channel index
*/
- if (WARN_ON(intsize != 2))
+ if (intsize != 2)
return -EINVAL;
- if (WARN_ON(intspec[1] >= data->channum))
+ if (intspec[0] >= 32)
+ return -EINVAL;
+
+ if (intspec[1] >= data->channum)
return -EINVAL;
*out_hwirq = intspec[0];
--
2.56.0
More information about the linux-arm-kernel
mailing list