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

irqchip: renesas-irqc: Fix irqc_probe error handling

The code in goto err3 path is wrong because it will call fee_irq() with k == 0,
which means it does free_irq(p->irq[-1].requested_irq, &p->irq[-1]);

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

authored by

Axel Lin and committed by
Simon Horman
dfaf820a c7788792

+2 -2
+2 -2
drivers/irqchip/irq-renesas-irqc.c
··· 248 248 249 249 return 0; 250 250 err3: 251 - for (; k >= 0; k--) 252 - free_irq(p->irq[k - 1].requested_irq, &p->irq[k - 1]); 251 + while (--k >= 0) 252 + free_irq(p->irq[k].requested_irq, &p->irq[k]); 253 253 254 254 irq_domain_remove(p->irq_domain); 255 255 err2: