Skip to content

Commit 3873afc

Browse files
Dan Carpentergregkh
authored andcommitted
irqchip/mchp-eic: Fix error code in mchp_eic_domain_alloc()
[ Upstream commit 7dbc0d4 ] 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: 00fa346 ("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>
1 parent 31ab2aa commit 3873afc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/irqchip/irq-mchp-eic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static int mchp_eic_domain_alloc(struct irq_domain *domain, unsigned int virq,
166166

167167
ret = irq_domain_translate_twocell(domain, fwspec, &hwirq, &type);
168168
if (ret || hwirq >= MCHP_EIC_NIRQ)
169-
return ret;
169+
return ret ?: -EINVAL;
170170

171171
switch (type) {
172172
case IRQ_TYPE_EDGE_RISING:

0 commit comments

Comments
 (0)