aboutsummaryrefslogtreecommitdiff
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2009-07-08 16:30:03 -0400
committerDave Jones <davej@redhat.com>2009-09-01 12:45:09 -0400
commit059019a3c3353b15d8efac5301f72036cc408bd4 (patch)
tree658b419d2fa088d8f6222cd3bd36a95394330954 /drivers/cpufreq
parent54e6fe167b8787460ee39e7c333b96e3e2e6a196 (diff)
[CPUFREQ] cleanup up -ENOMEM handling in cpufreq_add_dev
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-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 ce31e6e3d98..06eeff3c822 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)
goto module_out;
}
+ ret = -ENOMEM;
policy = kzalloc(sizeof(struct cpufreq_policy), GFP_KERNEL);
- if (!policy) {
- ret = -ENOMEM;
+ if (!policy)
goto nomem_out;
- }
- if (!alloc_cpumask_var(&policy->cpus, GFP_KERNEL)) {
- ret = -ENOMEM;
+
+ if (!alloc_cpumask_var(&policy->cpus, GFP_KERNEL))
goto err_free_policy;
- }
- if (!zalloc_cpumask_var(&policy->related_cpus, GFP_KERNEL)) {
- ret = -ENOMEM;
+
+ if (!zalloc_cpumask_var(&policy->related_cpus, GFP_KERNEL))
goto err_free_cpumask;
- }
policy->cpu = cpu;
cpumask_copy(policy->cpus, cpumask_of(cpu));