]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
irqchip/mchp-eic: Fix error code in mchp_eic_domain_alloc()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 9 Dec 2025 06:54:16 +0000 (09:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:40 +0000 (14:03 +0100)
commitefd65e2e2fd96f7aaa5cb07d79bbbfcfc80aa552
treed0ae2e64c69f88d1baea7012898247fb27874305
parentda07fa8730596596f0156900337444806c52ef45
irqchip/mchp-eic: Fix error code in mchp_eic_domain_alloc()

[ Upstream commit 7dbc0d40d8347bd9de55c904f59ea44bcc8dedb7 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/irqchip/irq-mchp-eic.c