aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 6602e1d02de2..5a639b173d54 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -696,13 +696,13 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr,
696{ 696{
697 struct cpufreq_policy * policy = to_policy(kobj); 697 struct cpufreq_policy * policy = to_policy(kobj);
698 struct freq_attr * fattr = to_attr(attr); 698 struct freq_attr * fattr = to_attr(attr);
699 ssize_t ret; 699 ssize_t ret = -EINVAL;
700 policy = cpufreq_cpu_get(policy->cpu); 700 policy = cpufreq_cpu_get(policy->cpu);
701 if (!policy) 701 if (!policy)
702 return -EINVAL; 702 goto no_policy;
703 703
704 if (lock_policy_rwsem_write(policy->cpu) < 0) 704 if (lock_policy_rwsem_write(policy->cpu) < 0)
705 return -EINVAL; 705 goto fail;
706 706
707 if (fattr->store) 707 if (fattr->store)
708 ret = fattr->store(policy, buf, count); 708 ret = fattr->store(policy, buf, count);
@@ -710,8 +710,9 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr,
710 ret = -EIO; 710 ret = -EIO;
711 711
712 unlock_policy_rwsem_write(policy->cpu); 712 unlock_policy_rwsem_write(policy->cpu);
713 713fail:
714 cpufreq_cpu_put(policy); 714 cpufreq_cpu_put(policy);
715no_policy:
715 return ret; 716 return ret;
716} 717}
717 718