From patchwork Fri Aug 25 14:31:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 111029 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1048354ybm; Fri, 25 Aug 2017 07:35:15 -0700 (PDT) X-Received: by 10.101.73.136 with SMTP id r8mr10243279pgs.106.1503671715236; Fri, 25 Aug 2017 07:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503671715; cv=none; d=google.com; s=arc-20160816; b=V5PXM8wLg3K1g+Y7ZjQKRnlAgUAYmbliAOo1/xFVAshQNbTzTUw8HTTztcfp1aSY/E PODsSpaCLVWJG8mbyS5qmSNJQuPV7uatGb0LB6EdZQdfTI3wG8lIQn9nGL7arn+hdz/3 XRjRPRp0/j05u4XkeRJsJQDMXtgoC7LCGEuHz9l3D5JWhk+Ie9h3bP6Sq0p/euEa/NM5 hUiRnuLezz8Oh6gB8SM+0EjVqbCQhx107ZbwBl3DYSn43ZjyQxfIIw8rfdJaKvtr3Ig/ XaaVD3VnQ7zR9oiLIKQrSxsXQ4ObMtvfMdF5oy+5AiX1z3IFgKilIDPVyhY+TfGOuia6 8/GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Od0gKFLU3pvY/QYoJKaVXTNGtxJq4cMSXEyqV4MwKdg=; b=FpPoLCzlonpg0TxyHvNCX93HakILWGy+4QSkDI4KMRneAk7u52IE5DVcJclfVuIyA/ TI6I0basSPszK7iNOg2kPTOV+5MDqspvDOa2Z1+kDXaKYEJDn69GgnNgY6aDcd3BhQoj NEZEfcuG0aPmz3GfXvyt9utokPWtjpbSezFHh3gnM6y2LuQjWenzMQfeGkVmOPmSZVVW lZSwdiTpP8GzQSMUWAQ7c3lLdY6gXrJKzk53U94ahZZOffLG45Mjh2aHrlv/FRYCClPp YA0nMsWnbLYKmc3K9YWDDlM1rRf6LDjQn24TF8MMdUNM73gDFdEZ3/hYZdaX3hSLLDHb MVzA== ARC-Authentication-Results: i=1; mx.google.com; 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 k7si5458072pln.414.2017.08.25.07.35.14; Fri, 25 Aug 2017 07:35:15 -0700 (PDT) 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; 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 S1756829AbdHYOfM (ORCPT + 26 others); Fri, 25 Aug 2017 10:35:12 -0400 Received: from foss.arm.com ([217.140.101.70]:54032 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755713AbdHYOc3 (ORCPT ); Fri, 25 Aug 2017 10:32:29 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 885E215B2; Fri, 25 Aug 2017 07:32:29 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 96A673F540; Fri, 25 Aug 2017 07:32:27 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v4 01/10] drivers base/arch_topology: free cpumask cpus_to_visit Date: Fri, 25 Aug 2017 15:31:57 +0100 Message-Id: <20170825143206.30467-2-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170825143206.30467-1-dietmar.eggemann@arm.com> References: <20170825143206.30467-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Free cpumask cpus_to_visit in case registering init_cpu_capacity_notifier has failed or the parsing of the cpu capacity-dmips-mhz property is done. The cpumask cpus_to_visit is only used inside the notifier call init_cpu_capacity_callback. Cc: Greg Kroah-Hartman Cc: Juri Lelli Reported-by: Vincent Guittot Signed-off-by: Dietmar Eggemann Acked-by: Vincent Guittot Acked-by: Viresh Kumar Tested-by: Juri Lelli Reviewed-by: Juri Lelli --- drivers/base/arch_topology.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index d1c33a85059e..562e0c93ae52 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -206,6 +206,8 @@ static struct notifier_block init_cpu_capacity_notifier = { static int __init register_cpufreq_notifier(void) { + int ret; + /* * on ACPI-based systems we need to use the default cpu capacity * until we have the necessary code to parse the cpu capacity, so @@ -221,8 +223,13 @@ static int __init register_cpufreq_notifier(void) cpumask_copy(cpus_to_visit, cpu_possible_mask); - return cpufreq_register_notifier(&init_cpu_capacity_notifier, - CPUFREQ_POLICY_NOTIFIER); + ret = cpufreq_register_notifier(&init_cpu_capacity_notifier, + CPUFREQ_POLICY_NOTIFIER); + + if (ret) + free_cpumask_var(cpus_to_visit); + + return ret; } core_initcall(register_cpufreq_notifier); @@ -230,6 +237,7 @@ static void parsing_done_workfn(struct work_struct *work) { cpufreq_unregister_notifier(&init_cpu_capacity_notifier, CPUFREQ_POLICY_NOTIFIER); + free_cpumask_var(cpus_to_visit); } #else