thermal: intel: powerclamp: Return -ENOMEM on allocation failure
PATCH 1/1 thermal: intel: powerclamp: Return -ENOMEM on allocation failure
cpumask_set() returns success (0) if alloc_cpumask_var() fails. Return -ENOMEM instead.
Fixes ebf519710218 ("thermal: intel: powerclamp: Add two module parameters")
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/thermal/intel/intel_powerclamp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/thermal/intel/intel_powerclamp.c +3 -2
@@ -157,9 +157,10 @@ static int cpumask_set(const char *arg, const struct kernel_param *kp) goto skip_cpumask_set; } - ret =alloc_cpumask_var (&new_mask,GFP_KERNEL ); -if (!ret) +if (!alloc_cpumask_var (&new_mask,GFP_KERNEL )) { + ret = -ENOMEM ; goto skip_cpumask_set; + } ret =bitmap_parse (arg,strlen (arg),cpumask_bits (new_mask), nr_cpumask_bits);