Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2275573pxy; Tue, 3 Aug 2021 02:10:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyl6UqTHjAfpP/GB6J7K5bluVuHfP7dGnUet7enZ6TzJnX5OSy1TlInVDhCYuoI4pvnQ8cb X-Received: by 2002:a05:6402:4412:: with SMTP id y18mr24097625eda.1.1627981834728; Tue, 03 Aug 2021 02:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627981834; cv=none; d=google.com; s=arc-20160816; b=WZErdjBSUArgAemMbXKB0g7JFEH17H/3aj+RX4Rg7/5QwwBKkngjrz3gdWMyD2hHkf nhHAzJitcUZuxkJnwThMWUHUO9H4E3ndI9CyuPZsj4douyAVk/DUUaxFEda6IfRshsTm DVJLUe6PUnIKXTjBkh2IiRxo22fXug2tNtqCPU+bBfyF3P4vJVsLEhuIiNFzYzc3QI7I Zdyr2gz8jcKnf2DXb1W4goJ1Q28r2GwEOPkgnJ5+HcYwXjGipMiEdsDEfOlUFT7YeaVf kupjCAxyU4U6UWXMTJV+lyGDi4XWiGUXvOnV4RCbsxPb2Rzsv5joh2Z7+/kZNk/UydzV RAIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=ZCKoRSuT4Fkb+7mosTDav13P6Eri8TnSQDxFtCjG/nA=; b=m40Hj4sZ0rMd7eh/i+klD0UKk5FSP2YgC3HfIaUwvWIegWIThm5L0M0HXip85IGXP9 x/6TpZhFhK8/SMxahWPiZvnZOCJ0N00x8rA5O9HHjUEJfFJQGDvH6JNKN3g/etnF4y/k xpHHynMv9A2jI7/Zi+FtUM6P/vDSjqaxCUMmTJCgVI+4L84EgAr/qrUaFhNc5OYWsXES wUFxSsKu200/tGex02yzyNekiu+fyOVdqyKm1xfLh9mEBnTEwBwkL08b6NAl8UVeDZOi Fv4Lm22e+1I/g7JqbGwPXwuouhs1adPxIAdUCj+TSnJb2GgG3JolRGJ46XUmfOpw/Bav GT5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o2si12876467eds.325.2021.08.03.02.10.10; Tue, 03 Aug 2021 02:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234935AbhHCJII (ORCPT + 99 others); Tue, 3 Aug 2021 05:08:08 -0400 Received: from foss.arm.com ([217.140.110.172]:45080 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234814AbhHCJII (ORCPT ); Tue, 3 Aug 2021 05:08:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 647DE11D4; Tue, 3 Aug 2021 02:07:57 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.9.94]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D3DDB3F40C; Tue, 3 Aug 2021 02:07:53 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org Cc: sudeep.holla@arm.com, cristian.marussi@arm.com, rjw@rjwysocki.net, viresh.kumar@linaro.org, nicola.mazzucato@arm.com, lukasz.luba@arm.com, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH v2] cpufreq: arm_scmi: Fix error path when allocation failed Date: Tue, 3 Aug 2021 10:07:44 +0100 Message-Id: <20210803090744.12143-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stop the initialization when cpumask allocation failed and return an error. Fixes: 80a064dbd556 ("scmi-cpufreq: Get opp_shared_cpus from opp-v2 for EM") Signed-off-by: Lukasz Luba --- changes: v2: - removed dev_warn() since it's not needed in this case - adjusted the patch description drivers/cpufreq/scmi-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index ec9a87ca2dbb..75f818d04b48 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -134,7 +134,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) } if (!zalloc_cpumask_var(&opp_shared_cpus, GFP_KERNEL)) - ret = -ENOMEM; + return -ENOMEM; /* Obtain CPUs that share SCMI performance controls */ ret = scmi_get_sharing_cpus(cpu_dev, policy->cpus); -- 2.17.1