Skip to content

Commit 8eb8141

Browse files
finley1226wzyy2
authored andcommitted
cpufreq: cpufreq_stats: prevent last_index = -1
Change-Id: I3fbe0db953cfc9d3215237c3b5f143672aae2c89 Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
1 parent b4e450c commit 8eb8141

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/cpufreq/cpufreq_stats.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy)
211211
stats->state_num = i;
212212
stats->last_time = get_jiffies_64();
213213
stats->last_index = freq_table_get_index(stats, policy->cur);
214+
#ifdef CONFIG_ARCH_ROCKCHIP
215+
if (stats->last_index == -1)
216+
stats->last_index = 0;
217+
#endif
214218

215219
policy->stats = stats;
216220
ret = sysfs_create_group(&policy->kobj, &stats_attr_group);

0 commit comments

Comments
 (0)