From patchwork Wed Apr 4 14:44:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 10322649 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 646B760318 for ; Wed, 4 Apr 2018 14:45:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52DE028EE3 for ; Wed, 4 Apr 2018 14:45:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47BF328EE8; Wed, 4 Apr 2018 14:45:37 +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 [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 AF60128EE3 for ; Wed, 4 Apr 2018 14:45:36 +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=oWkw3KQb6fwR43o3bTaCnaqK+KLkkay2Zm3XppsqxUM=; b=FXB 4fdVBp7LjaDG0JkAMDCQ98Qmu3QaeufIk7539UqVFRn68K83AemXMcnjSQITZl1f6s1jPB0ZfAsOz Hh1eVrnELmtKsCZ5pDYbkffjy2p75D55Gz/5xlkVS+HzfKBkfQusw3HAgP/7LzO6PmmZKt+8yj0TE waYixwLcUFKIsM5lSF9cr6vGBImnt2L/iuCWSRvDd0F1tIdGQMneCCHrBf4FG0qnrHSK2Qa7c0BcQ qqpkPsK8oktABMu/bes0dRiCrxcnbwO1NqrlAwcLOnitTJp4vJT/MMOXWnhIB8LqIkUWmKBLnrqUx FWpt3AtpUJEJAHorBLlQPWUgwuPTd4A==; 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 1f3jfE-0004ap-U4; Wed, 04 Apr 2018 14:45:28 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3jfB-0004ZX-4g for linux-arm-kernel@lists.infradead.org; Wed, 04 Apr 2018 14:45:27 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 71AFF20729; Wed, 4 Apr 2018 16:45:12 +0200 (CEST) Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id 450422064B; Wed, 4 Apr 2018 16:45:02 +0200 (CEST) From: Gregory CLEMENT To: "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org Subject: [PATCH] cpufreq: armada-37xx: Fix clock leak Date: Wed, 4 Apr 2018 16:44:44 +0200 Message-Id: <20180404144444.4142-1-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.16.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180404_074525_343168_41900F0C X-CRM114-Status: GOOD ( 10.39 ) 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: Andrew Lunn , Jason Cooper , Hua Jing , Antoine Tenart , Gregory CLEMENT , stable@vger.kernel.org, Maxime Chevallier , Nadav Haklai , Victor Gu , Neta Zur Hershkovits , Thomas Petazzoni , =?UTF-8?q?Miqu=C3=A8l=20Raynal?= , Marcin Wojtas , Wilson Ding , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth 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 There was no clk_put() balancing the clk_get(). This commit fixes it. Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx") Cc: Reported-by: Thomas Petazzoni Signed-off-by: Gregory CLEMENT Acked-by: Viresh Kumar --- drivers/cpufreq/armada-37xx-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpufreq/armada-37xx-cpufreq.c b/drivers/cpufreq/armada-37xx-cpufreq.c index c6ebc88a7d8d..72a2975499db 100644 --- a/drivers/cpufreq/armada-37xx-cpufreq.c +++ b/drivers/cpufreq/armada-37xx-cpufreq.c @@ -202,6 +202,7 @@ static int __init armada37xx_cpufreq_driver_init(void) cur_frequency = clk_get_rate(clk); if (!cur_frequency) { dev_err(cpu_dev, "Failed to get clock rate for CPU\n"); + clk_put(clk); return -EINVAL; } @@ -210,6 +211,7 @@ static int __init armada37xx_cpufreq_driver_init(void) return -EINVAL; armada37xx_cpufreq_dvfs_setup(nb_pm_base, clk, dvfs->divider); + clk_put(clk); for (load_lvl = ARMADA_37XX_DVFS_LOAD_0; load_lvl < LOAD_LEVEL_NR; load_lvl++) {