diff options
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 5f5f5ed11691..97b349a6f5c7 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -702,7 +702,9 @@ static int intel_pstate_init_cpu(unsigned int cpunum) | |||
702 | { | 702 | { |
703 | struct cpudata *cpu; | 703 | struct cpudata *cpu; |
704 | 704 | ||
705 | all_cpu_data[cpunum] = kzalloc(sizeof(struct cpudata), GFP_KERNEL); | 705 | if (!all_cpu_data[cpunum]) |
706 | all_cpu_data[cpunum] = kzalloc(sizeof(struct cpudata), | ||
707 | GFP_KERNEL); | ||
706 | if (!all_cpu_data[cpunum]) | 708 | if (!all_cpu_data[cpunum]) |
707 | return -ENOMEM; | 709 | return -ENOMEM; |
708 | 710 | ||
@@ -783,8 +785,6 @@ static void intel_pstate_stop_cpu(struct cpufreq_policy *policy) | |||
783 | 785 | ||
784 | del_timer_sync(&all_cpu_data[cpu_num]->timer); | 786 | del_timer_sync(&all_cpu_data[cpu_num]->timer); |
785 | intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); | 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 | static int intel_pstate_cpu_init(struct cpufreq_policy *policy) | 790 | static int intel_pstate_cpu_init(struct cpufreq_policy *policy) |