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

Commit 73be794e authored by Biao Long's avatar Biao Long Committed by Gerrit - the friendly Code Review server
Browse files

sched/walt: Fix kernel panic issue by uninitialized data



Threre is possible that time_delta is not initialized and caused
'Division by zero' exception, so move this trace into if condition
so that uninitialized data will not be used.

Change-Id: If7eb8df1c2cd7fe958b8a672d1f3b9c117caeed6
Signed-off-by: default avatarBiao long <blong@codeaurora.org>
parent 59a6fd58
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/syscore_ops.h>
@@ -2059,12 +2059,12 @@ update_task_rq_cpu_cycles(struct task_struct *p, struct rq *rq, int event,
		rq->task_exec_scale = DIV64_U64_ROUNDUP(cycles_delta *
				topology_get_cpu_scale(NULL, cpu),
				time_delta * rq->cluster->max_possible_freq);
		trace_sched_get_task_cpu_cycles(cpu, event,
				cycles_delta, time_delta, p);
	}

	p->cpu_cycles = cur_cycles;

	trace_sched_get_task_cpu_cycles(cpu, event,
					cycles_delta, time_delta, p);
}

static inline void run_walt_irq_work(u64 old_window_start, struct rq *rq)