summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-05-05 22:05:00 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2023-05-05 22:05:00 +0300
commit817e1af1b37230ef6bb40bec6ccaf9a800ee6610 (patch)
treee9601541887264f926fad191011a1cc34c0e05a6 /drivers
parentb49178e68fc7e3333c3d9f96eb09937ca84d05fd (diff)
parent2492ba4cd06dd24076f44327174816b04cddde90 (diff)
downloadlinux-817e1af1b37230ef6bb40bec6ccaf9a800ee6610.tar.xz
Merge tag 'thermal-6.4-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fixes from Rafael Wysocki: "These fix a NULL pointer dereference in the Intel powerclamp driver introduced during the 6.3 cycle and update MAINTAINERS to match recent code changes. Specifics: - Fix NULL pointer access in the Intel powerclamp thermal driver that occurs on attempts to set the cooling device state to 0 in the default configuration (Srinivas Pandruvada) - Drop the stale MAINTAINERS entry for the Intel Menlow thermal driver that has been removed recently (Lukas Bulwahn)" * tag 'thermal-6.4-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: MAINTAINERS: remove section INTEL MENLOW THERMAL DRIVER thermal: intel: powerclamp: Fix NULL pointer access issue
Diffstat (limited to 'drivers')
-rw-r--r--drivers/thermal/intel/intel_powerclamp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
index 91fc7e239497..36243a3972fd 100644
--- a/drivers/thermal/intel/intel_powerclamp.c
+++ b/drivers/thermal/intel/intel_powerclamp.c
@@ -703,6 +703,10 @@ static int powerclamp_set_cur_state(struct thermal_cooling_device *cdev,
new_target_ratio = clamp(new_target_ratio, 0UL,
(unsigned long) (max_idle - 1));
+
+ if (powerclamp_data.target_ratio == new_target_ratio)
+ goto exit_set;
+
if (!powerclamp_data.target_ratio && new_target_ratio > 0) {
pr_info("Start idle injection to reduce power\n");
powerclamp_data.target_ratio = new_target_ratio;