Commit c034871712730a33e0267095f48b62eae958499c
Committed by
Rafael J. Wysocki
1 parent
4521e1a0ce
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
intel_pstate: Don't lose sysfs settings during cpu offline
The user may have custom settings don't destroy them during suspend. Link: https://bugzilla.kernel.org/show_bug.cgi?id=80651 Reported-by: Tobias Jakobi <liquid.acid@gmx.net> Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff
drivers/cpufreq/intel_pstate.c
... | ... | @@ -702,8 +702,10 @@ |
702 | 702 | { |
703 | 703 | struct cpudata *cpu; |
704 | 704 | |
705 | - all_cpu_data[cpunum] = kzalloc(sizeof(struct cpudata), GFP_KERNEL); | |
706 | 705 | if (!all_cpu_data[cpunum]) |
706 | + all_cpu_data[cpunum] = kzalloc(sizeof(struct cpudata), | |
707 | + GFP_KERNEL); | |
708 | + if (!all_cpu_data[cpunum]) | |
707 | 709 | return -ENOMEM; |
708 | 710 | |
709 | 711 | cpu = all_cpu_data[cpunum]; |
... | ... | @@ -783,8 +785,6 @@ |
783 | 785 | |
784 | 786 | del_timer_sync(&all_cpu_data[cpu_num]->timer); |
785 | 787 | intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); |
786 | - kfree(all_cpu_data[cpu_num]); | |
787 | - all_cpu_data[cpu_num] = NULL; | |
788 | 788 | } |
789 | 789 | |
790 | 790 | static int intel_pstate_cpu_init(struct cpufreq_policy *policy) |