From: Thorsten Blum <blum@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
Lukasz Luba <lukasz.luba@arm.com>,
Thorsten Blum <blum@kernel.org>, Yury Norov <ynorov@nvidia.com>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] thermal: intel: powerclamp: Return -ENOMEM on allocation failure
Date: Wed, 11 Nov 2026 13:12:23 +0100 [thread overview]
Message-ID: <20261111121225.70218-3-blum@kernel.org> (raw)
cpumask_set() returns success (0) if alloc_cpumask_var() fails. Return
-ENOMEM instead.
Fixes: ebf519710218 ("thermal: intel: powerclamp: Add two module parameters")
Cc: stable@vger.kernel.org
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
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);
reply other threads:[~2026-11-11 12:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261111121225.70218-3-blum@kernel.org \
--to=blum@kernel.org \
--cc=daniel.lezcano@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=ynorov@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.