summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-03-17 12:27:37 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-03-17 12:27:37 -0700
commit35d8c39d0e52f5230716f61910881b309e4b1a04 (patch)
treed6e764fd610407b893ebf463a2a71ce5e7a70a97
parent1df27313f50a57497c1faeb6a6ae4ca939c85a7d (diff)
parent2046a24ae121cd107929655a6aaf3b8c5beea01f (diff)
Merge tag 'thermal-v5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal framework fix from Daniel Lezcano: "Fix NULL pointer access when the cooling device transition stats table failed to allocate due to a big number of states (Manaf Meethalavalappu Pallikunhi)" * tag 'thermal-v5.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal/core: Add NULL pointer check before using cooling device stats
-rw-r--r--drivers/thermal/thermal_sysfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 345917a58f2f..1c4aac8464a7 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -674,6 +674,9 @@ void thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev,
{
struct cooling_dev_stats *stats = cdev->stats;
+ if (!stats)
+ return;
+
spin_lock(&stats->lock);
if (stats->state == new_state)