linux-kernel.vger.kernel.org archive mirror
 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 related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] cpufreq: arm_scmi: Fix error path when allocation failed
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Sudeep Holla @ 2021-08-03 22:41 UTC (permalink / raw)
  To: Lukasz Luba
  Cc: linux-kernel, cristian.marussi, rjw, viresh.kumar,
	nicola.mazzucato, linux-arm-kernel, linux-pm

On Tue, Aug 03, 2021 at 10:07:44AM +0100, Lukasz Luba wrote:
> Stop the initialization when cpumask allocation failed and return an
> error.
>

Good catch!

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

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

* Re: [PATCH v2] cpufreq: arm_scmi: Fix error path when allocation failed
  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  4:02 ` Viresh Kumar
  2021-08-04 10:51   ` Lukasz Luba
  1 sibling, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2021-08-04  4:02 UTC (permalink / raw)
  To: Lukasz Luba
  Cc: linux-kernel, sudeep.holla, cristian.marussi, rjw,
	nicola.mazzucato, linux-arm-kernel, linux-pm

On 03-08-21, 10:07, Lukasz Luba wrote:
> 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);

Applied. Thanks.

-- 
viresh

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

* Re: [PATCH v2] cpufreq: arm_scmi: Fix error path when allocation failed
  2021-08-03 22:41 ` Sudeep Holla
@ 2021-08-04 10:51   ` Lukasz Luba
  0 siblings, 0 replies; 5+ messages in thread
From: Lukasz Luba @ 2021-08-04 10:51 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, cristian.marussi, rjw, viresh.kumar,
	nicola.mazzucato, linux-arm-kernel, linux-pm



On 8/3/21 11:41 PM, Sudeep Holla wrote:
> On Tue, Aug 03, 2021 at 10:07:44AM +0100, Lukasz Luba wrote:
>> Stop the initialization when cpumask allocation failed and return an
>> error.
>>
> 
> Good catch!
> 
> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
> 

Thank you for the review!

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

* Re: [PATCH v2] cpufreq: arm_scmi: Fix error path when allocation failed
  2021-08-04  4:02 ` Viresh Kumar
@ 2021-08-04 10:51   ` Lukasz Luba
  0 siblings, 0 replies; 5+ messages in thread
From: Lukasz Luba @ 2021-08-04 10:51 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: linux-kernel, sudeep.holla, cristian.marussi, rjw,
	nicola.mazzucato, linux-arm-kernel, linux-pm



On 8/4/21 5:02 AM, Viresh Kumar wrote:
> On 03-08-21, 10:07, Lukasz Luba wrote:
>> 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);
> 
> Applied. Thanks.
> 

Thank you for taking it.

^ 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).