From patchwork Thu Jul 6 09:49:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 107094 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1881383qge; Thu, 6 Jul 2017 02:50:21 -0700 (PDT) X-Received: by 10.99.113.11 with SMTP id m11mr25031358pgc.45.1499334621174; Thu, 06 Jul 2017 02:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499334621; cv=none; d=google.com; s=arc-20160816; b=OzOm3U3yoV1bdYFZ0gba71HNceqP/HTlndGl7y0oHlxlHl+ul9O01bwhwp/SRwTSWK ljMbqCXsgIsbqdwNtZa6pPmBVYvcLSJF1RchKL+K+hebO+Rv6lvgx6PN3gpR7Cakd1dL Y9ViW1qJudqqzF8lP5ZRlzBT8TbSoVGt8pmRzoXL2OIrJRrwGUdkjSv3TtDQ/PTTtrg3 oboOOoTnZeELCadq7SOL/YLSTh+LwSbkyz6J0OUE6nx+z79OFHO4o/cteAbdodSh3tHd qalT+e9mmn487LZBcRABrHzsX6hu1htIXI30+Kvaz/JtAFQoMKJv4KDgWgLf6o0n3m+S 9MJA== 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=Qm2iu6dXyRV5jR9YiCdbGn4JTTS6nsxLvmEGE7os3pk=; b=PnJLFEaCfAA2NRzxDe5pLFBm/TCJsOV20ES8cd9S+VeTPt+YQcFWvdvfBc3hqrG8in Nm4+PwQVQVzhpKfxQ/pAyjebTJ9edJVHya6IvMBYQj0NFugeixG08+/Kg5INqF1arGji Oai8qo95o3MGjBWKVuolUyp/Wd683RFFPfRRvulxGlAiXT+tWHhxs+tqYrXwxoUex9gF Lp/SCjr/lHj8gVmSf4KPbdsCme+uVFCPdFP8/MlVHcFa4HVoc6iRpdrJOoao5QxIs+rh bI98RcJX2U5U0tXFRQYOfwsIZBtCJK2vlRjmYcAreszQqJ11Ju6jm1auuiTC23q5GY7q nIyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 f1si1323311plb.254.2017.07.06.02.50.20; Thu, 06 Jul 2017 02:50:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751786AbdGFJuT (ORCPT + 14 others); Thu, 6 Jul 2017 05:50:19 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36070 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbdGFJuS (ORCPT ); Thu, 6 Jul 2017 05:50:18 -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 129C115AD; Thu, 6 Jul 2017 02:50:18 -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 14D9E3F3E1; Thu, 6 Jul 2017 02:50:15 -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" Subject: [PATCH v2 01/10] drivers base/arch_topology: free cpumask cpus_to_visit Date: Thu, 6 Jul 2017 10:49:39 +0100 Message-Id: <20170706094948.8779-2-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170706094948.8779-1-dietmar.eggemann@arm.com> References: <20170706094948.8779-1-dietmar.eggemann@arm.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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..f4832c662762 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,13 +223,19 @@ 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); static void parsing_done_workfn(struct work_struct *work) { + free_cpumask_var(cpus_to_visit); cpufreq_unregister_notifier(&init_cpu_capacity_notifier, CPUFREQ_POLICY_NOTIFIER); }