From patchwork Thu Jul 27 19:33:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108861 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2486441qge; Thu, 27 Jul 2017 12:36:00 -0700 (PDT) X-Received: by 10.99.127.21 with SMTP id a21mr4940484pgd.379.1501184159947; Thu, 27 Jul 2017 12:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184159; cv=none; d=google.com; s=arc-20160816; b=AmMAasU0H4IOHA7v+gMZQiUkpfIM3UGfG2GqzJG6o6cU0/wOeJUAn2vr248Y/F6n0S KyzjmAtPMa76NTXZpN1Q65805UTKoxUaWcE+pHQpnsZRjBd84Z05KT4QSYQ+CPAMwOgg Vs/Q0mGhFr6luLdUy5WfGh8e1zJBqM8zOS3OQ1hoO7e+hM+2X58ITrsHRlF9+vpw6ouL NEdGSY+DLyAMJPF4GuBj1kvu0fPAqA6MrB4qU5j9HcdL8KLLFWpmllchoxan5f6EtNR0 krr/EBc+p9RwIhEpOzjMjEEC3nA6yR7W5ne9lcUL3SaccweM4Q0WJU8eOct3NUQqByOR Rt1w== 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=AjespT3PYuaPNWogmq6hRNF8KR5E9iFjsiAy6vqN+ws=; b=QWl9MZWr3dTuxFtztEsPvv6t2OOz3qtDme1+iD6yJ0WQPBBtxHc54mrgX0JHWC2VwM y45zf/quyKhiP2gELhJpPUAYny270+/RL5SV/nn9QRGwRXg/OH/xOhdvgOIaqjWzbuoH lP0Tu2MnJF6xVN6WJPUOGgQMYv7Q00zmZDIHHyosQbNiUJt7KgNd1QWheZYTJTX8mAFl Aowgj53pdrrfnexAT8PLf29DQQWSguL2X4my35hgs9pEJJkFRR7pTcl3JFJY+bclTSjb ffdRscwLPI5tIjcqDmQOJsLNwHfP+ppkebpNar/J5Fex+G00ouJqy9TVHzqBUhkJ6HYk JSAg== 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 a68si8119301pli.278.2017.07.27.12.35.59; Thu, 27 Jul 2017 12:35:59 -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 S1751716AbdG0Tdp (ORCPT + 26 others); Thu, 27 Jul 2017 15:33:45 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51034 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751607AbdG0Tdk (ORCPT ); Thu, 27 Jul 2017 15:33:40 -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 C716D80D; Thu, 27 Jul 2017 12:33:39 -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 9167C3F540; Thu, 27 Jul 2017 12:33:37 -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 , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 01/10] drivers base/arch_topology: free cpumask cpus_to_visit Date: Thu, 27 Jul 2017 20:33:03 +0100 Message-Id: <20170727193312.9849-2-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-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 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