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

Commit 49632c6d authored by Connor O'Brien's avatar Connor O'Brien
Browse files

ANDROID: cpufreq: times: fix proc_time_in_state_show



Read times from p->time_in_state. Remove the "times" pointer, which is
never initialized.

Bug: 75238970
Test: /proc/<pid>/time_in_state now shows some nonzero values
Change-Id: I2f375b64ec39de034da3e24e5e5fb58b04958b76
Signed-off-by: default avatarConnor O'Brien <connoro@google.com>
parent 262c43ff
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -289,7 +289,6 @@ int proc_time_in_state_show(struct seq_file *m, struct pid_namespace *ns,
	unsigned int cpu, i;
	cputime_t cputime;
	unsigned long flags;
	u64 *times;
	struct cpu_freqs *freqs;
	struct cpu_freqs *last_freqs = NULL;

@@ -307,7 +306,7 @@ int proc_time_in_state_show(struct seq_file *m, struct pid_namespace *ns,
			cputime = 0;
			if (freqs->offset + i < p->max_state &&
			    p->time_in_state)
				cputime = times[freqs->offset + i];
				cputime = p->time_in_state[freqs->offset + i];
			seq_printf(m, "%u %lu\n", freqs->freq_table[i],
				   (unsigned long)cputime_to_clock_t(cputime));
		}