From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Axel Lin , Simon Horman Subject: [PATCH 3.10 01/62] irqchip: renesas-irqc: Fix irqc_probe error handling Date: Mon, 13 Jan 2014 16:26:26 -0800 Message-Id: <20140114002710.508747601@linuxfoundation.org> In-Reply-To: <20140114002710.464561569@linuxfoundation.org> References: <20140114002710.464561569@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Axel Lin commit dfaf820a13ec160f06556e08dab423818ba87f14 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/irqchip/irq-renesas-irqc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/irqchip/irq-renesas-irqc.c +++ b/drivers/irqchip/irq-renesas-irqc.c @@ -248,8 +248,8 @@ static int irqc_probe(struct platform_de 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: