[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210802204550.12647-1-lukasz.luba@arm.com>
Date: Mon, 2 Aug 2021 21:45:50 +0100
From: Lukasz Luba <lukasz.luba@....com>
To: linux-kernel@...r.kernel.org
Cc: sudeep.holla@....com, cristian.marussi@....com, rjw@...ysocki.net,
viresh.kumar@...aro.org, nicola.mazzucato@....com,
lukasz.luba@....com, linux-arm-kernel@...ts.infradead.org,
linux-pm@...r.kernel.org
Subject: [PATCH] cpufreq: arm_scmi: Fix error path when allocation failed
Print warning and return an error which would stop the initialization
when cpumask allocation failed.
Fixes: 80a064dbd556 ("scmi-cpufreq: Get opp_shared_cpus from opp-v2 for EM")
Signed-off-by: Lukasz Luba <lukasz.luba@....com>
---
drivers/cpufreq/scmi-cpufreq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index ec9a87ca2dbb..b159123e68fd 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -133,8 +133,10 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
return -ENODEV;
}
- if (!zalloc_cpumask_var(&opp_shared_cpus, GFP_KERNEL))
- ret = -ENOMEM;
+ if (!zalloc_cpumask_var(&opp_shared_cpus, GFP_KERNEL)) {
+ dev_warn(cpu_dev, "failed to allocate cpumask\n");
+ return -ENOMEM;
+ }
/* Obtain CPUs that share SCMI performance controls */
ret = scmi_get_sharing_cpus(cpu_dev, policy->cpus);
--
2.17.1
Powered by blists - more mailing lists