From patchwork Tue Jul 4 09:10:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris BREZILLON X-Patchwork-Id: 9824395 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 59789602F0 for ; Tue, 4 Jul 2017 09:11:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 456AD27FB1 for ; Tue, 4 Jul 2017 09:11:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37A8B2844C; Tue, 4 Jul 2017 09:11:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 815EB27FB1 for ; Tue, 4 Jul 2017 09:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ISD+NKzjCNXwaonZ6H/2gS9yfav0FbkdikXnELCmJiw=; b=E1z/+aS74oRpwsNNvQLt3WaxNu IA7h9rXFs/JQ7w+SiPDdZZyqnbIOLaM6fPv/AqJ/WlYF1WBu7akR53zmPmMsGyYF5VcTn5iGOhbKL EGczg5s65Ls18Ce4GzbjRqIDAq0BfdYNZdCI0tScQt2G6eFJ141i89l8AR40q8iBuWr8ruL2LzdeL 9xAIEVFjmJTMcUjVF7UUpOAcYSPzt4mAnd4ssON2EsrBa611iCRWBQZC/n0+sops6c2NT+L4uL6v6 MrVHsWy5cAmqN1kTf2ZGVxzTmGuFinOe8PIaQ8l3L9Y/OJ8LinfQYfxLiXkVs0IbbEO8nHnuW0h9h nB7Jyt3g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dSJra-00021x-WA; Tue, 04 Jul 2017 09:11:19 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dSJrX-0001pc-0o for linux-arm-kernel@lists.infradead.org; Tue, 04 Jul 2017 09:11:16 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 1862A21FC5; Tue, 4 Jul 2017 11:10:52 +0200 (CEST) Received: from bbrezillon.lan (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id D54AF21FC6; Tue, 4 Jul 2017 11:10:41 +0200 (CEST) From: Boris Brezillon To: Thomas Gleixner , Jason Cooper , Marc Zyngier , Nicolas Ferre , Alexandre Belloni Subject: [PATCH 2/3] irqchip/atmel-aic: Fix unbalanced refcount in aic_common_rtc_irq_fixup() Date: Tue, 4 Jul 2017 11:10:40 +0200 Message-Id: <1499159441-29801-2-git-send-email-boris.brezillon@free-electrons.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499159441-29801-1-git-send-email-boris.brezillon@free-electrons.com> References: <1499159441-29801-1-git-send-email-boris.brezillon@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170704_021115_256216_EFEB3133 X-CRM114-Status: GOOD ( 10.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP of_find_compatible_node() is calling of_node_put() on its first argument thus leading to an unbalanced of_node_get/put() issue if the node has not been retained before that. Instead of passing the root node, pass NULL, which does exactly the same: iterate over all DT nodes, starting from the root node. Signed-off-by: Boris Brezillon Reported-by: Alexandre Belloni Fixes: 3d61467f9bab ("irqchip: atmel-aic: Implement RTC irq fixup") Cc: --- drivers/irqchip/irq-atmel-aic-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c index 7c5a43488d27..056507099725 100644 --- a/drivers/irqchip/irq-atmel-aic-common.c +++ b/drivers/irqchip/irq-atmel-aic-common.c @@ -142,9 +142,9 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root) struct device_node *np; void __iomem *regs; - np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc"); + np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-rtc"); if (!np) - np = of_find_compatible_node(root, NULL, + np = of_find_compatible_node(NULL, NULL, "atmel,at91sam9x5-rtc"); if (!np)