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

Commit e0ee1d4c authored by Mahesh Sivasubramanian's avatar Mahesh Sivasubramanian
Browse files

msm-core: Check for NULL pointer deference



In scenarios, where userspace hasn't populated the power numbers, per-cpu
pointer might be NULL. Add check to prevent any NULL pointer deferences.

Change-Id: Id193634dc764cb255a58026370ec7f9ef8abeebb
Signed-off-by: default avatarMahesh Sivasubramanian <msivasub@codeaurora.org>
parent 678c4bec
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -187,6 +187,9 @@ static void repopulate_stats(int cpu)
	int temp_point;
	int temp_point;
	struct cpu_pstate_pwr *pt =  per_cpu(ptable, cpu);
	struct cpu_pstate_pwr *pt =  per_cpu(ptable, cpu);


	if (!pt)
		return;

	if (cpu_node->temp < TEMP_BASE_POINT)
	if (cpu_node->temp < TEMP_BASE_POINT)
		temp_point = 0;
		temp_point = 0;
	else if (cpu_node->temp > TEMP_MAX_POINT)
	else if (cpu_node->temp > TEMP_MAX_POINT)