From: Axel Lin Date: Mon, 6 May 2013 09:03:32 +0000 (+0800) Subject: irqchip: renesas-irqc: Fix irqc_probe error handling X-Git-Tag: next-20130527~8^2^18~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=20ecf9cb57b2152b492098637d1d3cbe5c14ea15;p=karo-tx-linux.git 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 Signed-off-by: Simon Horman --- diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c index 649cd69a51f4..3651f77ecd1d 100644 --- a/drivers/irqchip/irq-renesas-irqc.c +++ b/drivers/irqchip/irq-renesas-irqc.c @@ -252,8 +252,8 @@ static int irqc_probe(struct platform_device *pdev) return 0; err3: - for (; k >= 0; k--) - free_irq(p->irq[k - 1].requested_irq, &p->irq[k - 1]); + while (--k >= 0) + free_irq(p->irq[k].requested_irq, &p->irq[k]); irq_domain_remove(p->irq_domain); err2: