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

Commit 501a08a8 authored by Daniel Rosenberg's avatar Daniel Rosenberg Committed by Ruchi Kandoi
Browse files

cpufreq: stats: hold reference on global cpufreq



As in f8ad216f37e6a7b07d5f6982a25c426c72f661f6,
cpufreq stat must grab a reference to the global
cpufreq kobject in order to use it. Otherwise,
the kobj->sd will be NULL, and trigger a BUG in
sysfs_create_file.

Change-Id: If7d1c13c6ebb1678e1cd33d46eba04a41a0a796d
Signed-off-by: default avatarDaniel Rosenberg <drosen@google.com>
parent a7f9ba39
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -570,6 +570,7 @@ static int __init cpufreq_stats_init(void)
	}

	create_all_freq_table();
	WARN_ON(cpufreq_get_global_kobject());
	ret = sysfs_create_file(cpufreq_global_kobject,
			&_attr_all_time_in_state.attr);
	if (ret)
@@ -588,6 +589,7 @@ static void __exit cpufreq_stats_exit(void)
	for_each_online_cpu(cpu)
		cpufreq_stats_free_table(cpu);
	cpufreq_allstats_free();
	cpufreq_put_global_kobject();
}

MODULE_AUTHOR("Zou Nan hai <nanhai.zou@intel.com>");