public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irqchip: renesas-irqc: Fix irqc_probe error handling
@ 2013-05-06  9:03 Axel Lin
  2013-05-08  0:57 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2013-05-06  9:03 UTC (permalink / raw)
  To: Simon Horman
  Cc: Magnus Damm, Guennadi Liakhovetski, Thomas Gleixner, linux-kernel

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>
---
 drivers/irqchip/irq-renesas-irqc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index 649cd69..3651f77 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:
-- 
1.8.1.2




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-08  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-06  9:03 [PATCH] irqchip: renesas-irqc: Fix irqc_probe error handling Axel Lin
2013-05-08  0:57 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox