Commit e0a02923 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power management fix from Rafael Wysocki:
 "Prevent cpufreq_update_limits() from crashing the kernel due to a NULL
  pointer dereference when it is called before registering a cpufreq
  driver, for instance as a result of a notification triggered by the
  platform firmware (Rafael Wysocki)"

* tag 'pm-6.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: Reference count policy in cpufreq_update_limits()
parents e69e6e46 9e4e2490
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2809,6 +2809,12 @@ EXPORT_SYMBOL(cpufreq_update_policy);
 */
void cpufreq_update_limits(unsigned int cpu)
{
	struct cpufreq_policy *policy __free(put_cpufreq_policy);

	policy = cpufreq_cpu_get(cpu);
	if (!policy)
		return;

	if (cpufreq_driver->update_limits)
		cpufreq_driver->update_limits(cpu);
	else