Skip to content

Commit e0a0292

Browse files
committed
Merge tag 'pm-6.15-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
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()
2 parents e69e6e4 + 9e4e249 commit e0a0292

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,6 +2809,12 @@ EXPORT_SYMBOL(cpufreq_update_policy);
28092809
*/
28102810
void cpufreq_update_limits(unsigned int cpu)
28112811
{
2812+
struct cpufreq_policy *policy __free(put_cpufreq_policy);
2813+
2814+
policy = cpufreq_cpu_get(cpu);
2815+
if (!policy)
2816+
return;
2817+
28122818
if (cpufreq_driver->update_limits)
28132819
cpufreq_driver->update_limits(cpu);
28142820
else

0 commit comments

Comments
 (0)