diff options
| author | Dave Jones <davej@redhat.com> | 2008-03-05 14:22:25 -0500 |
|---|---|---|
| committer | Dave Jones <davej@redhat.com> | 2008-03-05 14:45:31 -0500 |
| commit | a07530b44547a892dae59f4e0f141f4e6f5e2e40 (patch) | |
| tree | 0e14831fba0a476f213d1f5e0f5795b16e6a5c85 | |
| parent | 0db4a8a99f6a8534c526e8c9d4b13d098400d485 (diff) | |
[CPUFREQ] Fix missing cpufreq_cpu_put() call in ->store
refactor to use gotos instead of explicit exit paths
Signed-off-by: Dave Jones <davej@redhat.com>
| -rw-r--r-- | drivers/cpufreq/cpufreq.c | 9 |
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 | 713 | fail: | |
| 714 | cpufreq_cpu_put(policy); | 714 | cpufreq_cpu_put(policy); |
| 715 | no_policy: | ||
| 715 | return ret; | 716 | return ret; |
| 716 | } | 717 | } |
| 717 | 718 | ||
