Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754167AbdFSPj0 (ORCPT ); Mon, 19 Jun 2017 11:39:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45356 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753614AbdFSPeg (ORCPT ); Mon, 19 Jun 2017 11:34:36 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , Thomas Gleixner Subject: [PATCH 3.18 30/32] genirq: Release resources in __setup_irq() error path Date: Mon, 19 Jun 2017 23:21:14 +0800 Message-Id: <20170619152037.326162089@linuxfoundation.org> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170619152035.750974520@linuxfoundation.org> References: <20170619152035.750974520@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1145 Lines: 38 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heiner Kallweit commit fa07ab72cbb0d843429e61bf179308aed6cbe0dd upstream. In case __irq_set_trigger() fails the resources requested via irq_request_resources() are not released. Add the missing release call into the error handling path. Fixes: c1bacbae8192 ("genirq: Provide irq_request/release_resources chip callbacks") Signed-off-by: Heiner Kallweit Signed-off-by: Thomas Gleixner Link: http://lkml.kernel.org/r/655538f5-cb20-a892-ff15-fbd2dd1fa4ec@gmail.com Signed-off-by: Greg Kroah-Hartman --- kernel/irq/manage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1156,8 +1156,10 @@ __setup_irq(unsigned int irq, struct irq ret = __irq_set_trigger(desc, irq, new->flags & IRQF_TRIGGER_MASK); - if (ret) + if (ret) { + irq_release_resources(desc); goto out_mask; + } } desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \