LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2] cpufreq: arm_scmi: Fix error path when allocation failed
@ 2021-08-03  9:07 Lukasz Luba
  2021-08-03 22:41 ` Sudeep Holla
  2021-08-04  4:02 ` Viresh Kumar
  0 siblings, 2 replies; 5+ messages in thread
From: Lukasz Luba @ 2021-08-03  9:07 UTC (permalink / raw)
  To: linux-kernel
  Cc: sudeep.holla, cristian.marussi, rjw, viresh.kumar,
	nicola.mazzucato, lukasz.luba, linux-arm-kernel, linux-pm

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 <lukasz.luba@arm.com>
---
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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-04 10:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03  9:07 [PATCH v2] cpufreq: arm_scmi: Fix error path when allocation failed Lukasz Luba
2021-08-03 22:41 ` Sudeep Holla
2021-08-04 10:51   ` Lukasz Luba
2021-08-04  4:02 ` Viresh Kumar
2021-08-04 10:51   ` Lukasz Luba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).