]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
irqchip: renesas-irqc: Fix irqc_probe error handling
authorAxel Lin <axel.lin@ingics.com>
Mon, 6 May 2013 09:03:32 +0000 (17:03 +0800)
committerSimon Horman <horms+renesas@verge.net.au>
Wed, 22 May 2013 12:55:40 +0000 (21:55 +0900)
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>
drivers/irqchip/irq-renesas-irqc.c

index 649cd69a51f450123e4d8819fc5fec72622a241a..3651f77ecd1de8c1d20f0a3ba4ad2f0bb3b6d779 100644 (file)
@@ -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: