aboutsummaryrefslogtreecommitdiff
path: root/lib/percpu_counter.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-16 20:57:41 +0100
committerIngo Molnar <mingo@elte.hu>2008-12-16 20:57:41 +0100
commitdd7a5230cd651bfb119d222561c4032f30dd5659 (patch)
tree85628ef75d1f512f43df6f760980b6cce6cf40c7 /lib/percpu_counter.c
parent050dc6944b9ca2186f4729ab44e0da3743933941 (diff)
parent8b1fae4e4200388b64dd88065639413cb3f1051c (diff)
Merge commit 'v2.6.28-rc8' into x86/cpufeature
Diffstat (limited to 'lib/percpu_counter.c')
-rw-r--r--lib/percpu_counter.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c
index a8663890a88..b255b939bc1 100644
--- a/lib/percpu_counter.c
+++ b/lib/percpu_counter.c
@@ -62,10 +62,7 @@ s64 __percpu_counter_sum(struct percpu_counter *fbc)
for_each_online_cpu(cpu) {
s32 *pcount = per_cpu_ptr(fbc->counters, cpu);
ret += *pcount;
- *pcount = 0;
}
- fbc->count = ret;
-
spin_unlock(&fbc->lock);
return ret;
}
@@ -104,13 +101,13 @@ void percpu_counter_destroy(struct percpu_counter *fbc)
if (!fbc->counters)
return;
- free_percpu(fbc->counters);
- fbc->counters = NULL;
#ifdef CONFIG_HOTPLUG_CPU
mutex_lock(&percpu_counters_lock);
list_del(&fbc->list);
mutex_unlock(&percpu_counters_lock);
#endif
+ free_percpu(fbc->counters);
+ fbc->counters = NULL;
}
EXPORT_SYMBOL(percpu_counter_destroy);