From patchwork Tue Sep 26 16:41:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 114268 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4042652qgf; Tue, 26 Sep 2017 09:42:28 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDraR+9ob50cYm06MNxwIqeODuL6eAs24YZPoC3qwpvEH+aIttCAY3mh/ktdCeiXBDn37Ez X-Received: by 10.84.172.131 with SMTP id n3mr11415078plb.408.1506444148312; Tue, 26 Sep 2017 09:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506444148; cv=none; d=google.com; s=arc-20160816; b=xmH8he4z8MN9Vy4clxzBXxgfAZ437ptYMZOCcGofUUwI3U3xBkPFHBpM2GVkrQ0Yzx 6amSb0koenMLfE1KUQjcsv+ZN7XlnycdIXhDsToy0kA5hWA+UVHFK/GLw99DmURcmM2p zAP9CEXxSItS7mhAzCMI9HLHR26VslsJfhoyArnmi5jM5EbsJB/5zM+OA6GGkXg92rlE 5zFRGHthCee3jAN/wb3mLowZnYRKMrGJTlDTmFxuBMNvg77X+rWaZ7Pp3QkapyyzgNo7 5N2pOn8MQXE1Zs5aiuXDfhArxWDUE098i8R3bir/nrqUDtCL4qTLv1W4+nFPzeuFuziU WpcQ== 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=CMcSefjltR29SCcLQLQ82/r45hHUlv/E9HvlEj9Xj3o=; b=I/ShJ7Iqt6AhgcpXnEAzhrbtkG6RKPxmPS7Y0tfsBILwA2FIS4+CtPjP0BPKSZaHMK SiwYLbEUz13VkuesgRjlYm1UkNU4fbjorYJkE2L8G+usZy4a1U095teNc/tLBuC8q70N LM/FfdbqD1IdXxfUrMJlKsm3aWebZ2s7edsMaLEZOENfkQgF+yMphLQdi1cTuHmQU3bx aj9ZBUYiEnmvU9SrKXClDAEQQ/g58fQSPSPwEKe6sxqYnwxz4j+lSspM1cQcfUH7gVNr hoV8fmdDvEbNycvSzdy/grz1NMLzhIV4QC51Gt2hNAGdRsVe8sAY6QRHq7TqEWKVBpMD 228Q== 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 a1si6139536pld.153.2017.09.26.09.42.28; Tue, 26 Sep 2017 09:42:28 -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 S1030631AbdIZQmZ (ORCPT + 26 others); Tue, 26 Sep 2017 12:42:25 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35998 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969099AbdIZQmX (ORCPT ); Tue, 26 Sep 2017 12:42:23 -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 770FE15A2; Tue, 26 Sep 2017 09:42:23 -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 1E3A03F483; Tue, 26 Sep 2017 09:42:20 -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 v5 01/10] drivers base/arch_topology: free cpumask cpus_to_visit Date: Tue, 26 Sep 2017 17:41:06 +0100 Message-Id: <20170926164115.32367-2-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170926164115.32367-1-dietmar.eggemann@arm.com> References: <20170926164115.32367-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 41be9ff7d70a..e9bb368f32b3 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -212,6 +212,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 @@ -227,8 +229,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); @@ -236,6 +243,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