Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp461131ybl; Tue, 28 Jan 2020 06:20:02 -0800 (PST) X-Google-Smtp-Source: APXvYqx4E2JMG4oKcQ+1An9HzaafvX4Gqc1aLH9PDoGXewy0uRAtD5sioVPsfTbe7qR8YiN9EXbo X-Received: by 2002:a9d:7592:: with SMTP id s18mr17179247otk.130.1580221202397; Tue, 28 Jan 2020 06:20:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221202; cv=none; d=google.com; s=arc-20160816; b=r25D2kSnBPpXp4Vd+BcQVsmOVvw+q0j9CtzrbhaG/48c8crFXhp8BJQN5J+7gydUQk s/sJ9XGtpJQF/xUD7i8VunCwhjm6JOXOQ61y4/BbEAB60/9hChXu16WU2iItn+SXBn6i w+j4/+egDBfQOoW8OWXxmSHlcfu8rKKYRlTf8vb62awOfzUhL1jwTO7WD3PkjKvkdywx 8xw0HOvONChT71/p18b9DgVi9mcbaNwADM9GpWxkSZO5uSGVNYv2Ju1+hPJAoAK84Vz8 UyH4oYQodfoalHsw27I5GHL691u36YH/QG3zLtyp0A6gX0nkqLlRvbm832o1TMwIajmu MJQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1+uROWhrLwlWMMByt3c25klxCtTDFYLa2j0C3LcUV9s=; b=KKQNg4isV34/3G9O/cxDIt8nc2nHA1TYiKfOMHM6sXYzns664xr5yseBwcVX/MVnUH tDb2gnzFml2GPzjENgusrwpIeq9xIDht1NALfmyfo2UvS3tfwl8osTj4MhtO8ZEv61lc wYjUH6YMEtbDfIw6Y9ieXmrYun8CrqqXOJQ9Ow71ZN+cX1r3c8+iw07ZoanHmNXm0Avh SbRvEc+49jPT4J4FHiYEjU+NePcXCS8awczvTwaBgwDr+Fv72qlPoo4MF9yc57VIp+9j KH0ZImMRQO/WHHdASHJsoeskbqTNwR60r5Obr9x7lKRRB0t5XqExdEdAxtaLLhu3HMGw PNZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ik9YDhfI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l140si2267198oib.114.2020.01.28.06.19.50; Tue, 28 Jan 2020 06:20:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ik9YDhfI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730349AbgA1ORy (ORCPT + 99 others); Tue, 28 Jan 2020 09:17:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:41614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727339AbgA1ORr (ORCPT ); Tue, 28 Jan 2020 09:17:47 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A9F462071E; Tue, 28 Jan 2020 14:17:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221067; bh=swb8ylO3whG6oEYMtfBN6kOtQsnU8P5uHHFFwn02onw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ik9YDhfINZ7CQEwagon1e5vQjRScEnSnMltY2WCr8gYilly1dLoPsIkZF6GLGY0iA eNvgrM5IFlJDyb8Jqn8xDktyOecxFZLS/YYDM8okGEztunDM1KJC/kRyl+wQahQ1qD oy7qkGfBb6StvJO1lb4m1N5Bll/I9E80wQWtvOgw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yangtao Li , Stephen Boyd , Sasha Levin Subject: [PATCH 4.9 028/271] clk: socfpga: fix refcount leak Date: Tue, 28 Jan 2020 15:02:57 +0100 Message-Id: <20200128135854.774931855@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yangtao Li [ Upstream commit 7f9705beeb3759e69165e7aff588f6488ff6c1ac ] The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount. Signed-off-by: Yangtao Li Fixes: 5343325ff3dd ("clk: socfpga: add a clock driver for the Arria 10 platform") Fixes: a30d27ed739b ("clk: socfpga: fix clock driver for 3.15") Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/socfpga/clk-pll-a10.c | 1 + drivers/clk/socfpga/clk-pll.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/clk/socfpga/clk-pll-a10.c b/drivers/clk/socfpga/clk-pll-a10.c index 35fabe1a32c30..269467e8e07e1 100644 --- a/drivers/clk/socfpga/clk-pll-a10.c +++ b/drivers/clk/socfpga/clk-pll-a10.c @@ -95,6 +95,7 @@ static struct clk * __init __socfpga_pll_init(struct device_node *node, clkmgr_np = of_find_compatible_node(NULL, NULL, "altr,clk-mgr"); clk_mgr_a10_base_addr = of_iomap(clkmgr_np, 0); + of_node_put(clkmgr_np); BUG_ON(!clk_mgr_a10_base_addr); pll_clk->hw.reg = clk_mgr_a10_base_addr + reg; diff --git a/drivers/clk/socfpga/clk-pll.c b/drivers/clk/socfpga/clk-pll.c index c7f463172e4b9..b4b44e9b59011 100644 --- a/drivers/clk/socfpga/clk-pll.c +++ b/drivers/clk/socfpga/clk-pll.c @@ -100,6 +100,7 @@ static __init struct clk *__socfpga_pll_init(struct device_node *node, clkmgr_np = of_find_compatible_node(NULL, NULL, "altr,clk-mgr"); clk_mgr_base_addr = of_iomap(clkmgr_np, 0); + of_node_put(clkmgr_np); BUG_ON(!clk_mgr_base_addr); pll_clk->hw.reg = clk_mgr_base_addr + reg; -- 2.20.1