[PATCH] thermal: intel: powerclamp: Return -ENOMEM on allocation failure
From: Thorsten Blum
Date: Wed Nov 11 2026 - 07:40:31 EST
cpumask_set() returns success (0) if alloc_cpumask_var() fails. Return
-ENOMEM instead.
Fixes: ebf519710218 ("thermal: intel: powerclamp: Add two module parameters")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
drivers/thermal/intel/intel_powerclamp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
index 1ffcb0a699e5..df898fc3f3e6 100644
--- a/drivers/thermal/intel/intel_powerclamp.c
+++ b/drivers/thermal/intel/intel_powerclamp.c
@@ -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);