Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754927AbdGCNg4 (ORCPT ); Mon, 3 Jul 2017 09:36:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34292 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754908AbdGCNgy (ORCPT ); Mon, 3 Jul 2017 09:36:54 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Krzysztof Kozlowski , Viresh Kumar , "Rafael J. Wysocki" Subject: [PATCH 3.18 34/36] cpufreq: s3c2416: double free on driver init error path Date: Mon, 3 Jul 2017 15:34:31 +0200 Message-Id: <20170703133257.637634695@linuxfoundation.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170703133256.260692013@linuxfoundation.org> References: <20170703133256.260692013@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: 1064 Lines: 33 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter commit a69261e4470d680185a15f748d9cdafb37c57a33 upstream. The "goto err_armclk;" error path already does a clk_put(s3c_freq->hclk); so this is a double free. Fixes: 34ee55075265 ([CPUFREQ] Add S3C2416/S3C2450 cpufreq driver) Signed-off-by: Dan Carpenter Reviewed-by: Krzysztof Kozlowski Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/s3c2416-cpufreq.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/cpufreq/s3c2416-cpufreq.c +++ b/drivers/cpufreq/s3c2416-cpufreq.c @@ -400,7 +400,6 @@ static int s3c2416_cpufreq_driver_init(s rate = clk_get_rate(s3c_freq->hclk); if (rate < 133 * 1000 * 1000) { pr_err("cpufreq: HCLK not at 133MHz\n"); - clk_put(s3c_freq->hclk); ret = -EINVAL; goto err_armclk; }