From patchwork Fri Jul 13 11:13:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 10523063 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 1628B60245 for ; Fri, 13 Jul 2018 11:16:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 042BA2934C for ; Fri, 13 Jul 2018 11:16:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB7BA2956B; Fri, 13 Jul 2018 11:16:58 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 3CA052934C for ; Fri, 13 Jul 2018 11:16:58 +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: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:In-Reply-To: References:List-Owner; bh=tOMEkfE552qLC1T8JQe0zIXowwHTGWMqvFpge4FI5rY=; b=iM6 at4YWzRa3WVg61n3V3GUiE5a1WypTEEfp1ftdtJtL1BNuW+7LeGP3t2S0QXmWEa2/s9tlJAYrUfeG BmQRN+P4dfYRkZ7ZLRuKGeexDJidJ/nX9KTEeBffxwUGDE9NZ/mmpYvhwf7igQrU8tDJsUuWomkcE Wi5p/NZdY+Zj829c4/5SlnjPne9SzM9+upOuazNvQF2ownHfuWtODM2X53HCD0Ywciwwppan1PO8/ RVbbNc8UwQWfpIWvgb4V2FuO9vrZh+p2E/tjWc60/s9HdPsW3TCKsCBCKuHn7o6onD8KELgiJf8tE dB/wM9PG4yXWB2maPqomPoLhZ9J9P1Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdw4E-0004H7-PR; Fri, 13 Jul 2018 11:16:54 +0000 Received: from www.osadl.org ([62.245.132.105]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdw44-0003fM-JD for linux-arm-kernel@lists.infradead.org; Fri, 13 Jul 2018 11:16:52 +0000 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id w6DBE4oA030126; Fri, 13 Jul 2018 13:14:04 +0200 From: Nicholas Mc Guire To: Shawn Guo Subject: [PATCH] clk: imx6ul: fix missing of_node_put() Date: Fri, 13 Jul 2018 13:13:20 +0200 Message-Id: <1531480400-7664-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180713_041645_773216_15D2E767 X-CRM114-Status: UNSURE ( 8.51 ) X-CRM114-Notice: Please train this message. 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: Frank Li , Stephen Boyd , Michael Turquette , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, NXP Linux Team , Pengutronix Kernel Team , Nicholas Mc Guire , Fabio Estevam , Sascha Hauer , 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 returning a device node with refcount incremented and must be explicitly decremented after the last use which is right after the us in of_iomap() here. Signed-off-by: Nicholas Mc Guire Fixes: commit 787b4271a6a0 ("clk: imx: add imx6ul clk tree support") --- Problem located with experimental coccinelle script Patch was compile tested with: imx_v6_v7_defconfig (implies CONFIG_SOC_IMX6UL=y) Patch is against 4.18-rc4 (localversion-next is next-20180713) drivers/clk/imx/clk-imx6ul.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c index d3f7f4d..361b43f 100644 --- a/drivers/clk/imx/clk-imx6ul.c +++ b/drivers/clk/imx/clk-imx6ul.c @@ -135,6 +135,7 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) np = of_find_compatible_node(NULL, NULL, "fsl,imx6ul-anatop"); base = of_iomap(np, 0); + of_node_put(np); WARN_ON(!base); clks[IMX6UL_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));