aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index ce31e6e3d982..06eeff3c822f 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -798,19 +798,16 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
798 goto module_out; 798 goto module_out;
799 } 799 }
800 800
801 ret = -ENOMEM;
801 policy = kzalloc(sizeof(struct cpufreq_policy), GFP_KERNEL); 802 policy = kzalloc(sizeof(struct cpufreq_policy), GFP_KERNEL);
802 if (!policy) { 803 if (!policy)
803 ret = -ENOMEM;
804 goto nomem_out; 804 goto nomem_out;
805 } 805
806 if (!alloc_cpumask_var(&policy->cpus, GFP_KERNEL)) { 806 if (!alloc_cpumask_var(&policy->cpus, GFP_KERNEL))
807 ret = -ENOMEM;
808 goto err_free_policy; 807 goto err_free_policy;
809 } 808
810 if (!zalloc_cpumask_var(&policy->related_cpus, GFP_KERNEL)) { 809 if (!zalloc_cpumask_var(&policy->related_cpus, GFP_KERNEL))
811 ret = -ENOMEM;
812 goto err_free_cpumask; 810 goto err_free_cpumask;
813 }
814 811
815 policy->cpu = cpu; 812 policy->cpu = cpu;
816 cpumask_copy(policy->cpus, cpumask_of(cpu)); 813 cpumask_copy(policy->cpus, cpumask_of(cpu));