diff options
-rw-r--r-- | kernel/sched.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 2246591f371..f4c413bdd38 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -10001,11 +10001,10 @@ static void cpuacct_charge(struct task_struct *tsk, u64 cputime) cpu = task_cpu(tsk); ca = task_ca(tsk); - do { + for (; ca; ca = ca->parent) { u64 *cpuusage = per_cpu_ptr(ca->cpuusage, cpu); *cpuusage += cputime; - ca = ca->parent; - } while (ca); + } } struct cgroup_subsys cpuacct_subsys = { |