Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70145df8 authored by Mukesh Ojha's avatar Mukesh Ojha
Browse files

FROMLIST: thermal: Fix NULL pointer dereference issue

Cooling stats variable inside thermal_cooling_device_stats_update()
can get NULL. We should add a valid check on stat before using it.

Bug: 173355233
Link: https://lore.kernel.org/lkml/1605544181-5348-1-git-send-email-mojha@codeaurora.org/


Change-Id: I48105dcf8ff81d272534c59b7120a6d9fc831d04
Signed-off-by: default avatarMukesh Ojha <mojha@codeaurora.org>
parent 7982ae0c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -770,6 +770,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)