Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irqchip/mchp-eic: Fix error code in mchp_eic_domain_alloc()

If irq_domain_translate_twocell() sets "hwirq" to >= MCHP_EIC_NIRQ (2) then
it results in an out of bounds access.

The code checks for invalid values, but doesn't set the error code. Return
-EINVAL in that case, instead of returning success.

Fixes: 00fa3461c86d ("irqchip/mchp-eic: Add support for the Microchip EIC")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Link: https://patch.msgid.link/aTfHmOz6IBpTIPU5@stanley.mountain

authored by

Dan Carpenter and committed by
Thomas Gleixner
7dbc0d40 55026a96

+1 -1
+1 -1
drivers/irqchip/irq-mchp-eic.c
··· 170 170 171 171 ret = irq_domain_translate_twocell(domain, fwspec, &hwirq, &type); 172 172 if (ret || hwirq >= MCHP_EIC_NIRQ) 173 - return ret; 173 + return ret ?: -EINVAL; 174 174 175 175 switch (type) { 176 176 case IRQ_TYPE_EDGE_RISING: