aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/cgroup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 4c475ce4e222..cb7c72b91f46 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2007,14 +2007,16 @@ int cgroup_scan_tasks(struct cgroup_scanner *scan)
2007 */ 2007 */
2008static int pid_array_load(pid_t *pidarray, int npids, struct cgroup *cgrp) 2008static int pid_array_load(pid_t *pidarray, int npids, struct cgroup *cgrp)
2009{ 2009{
2010 int n = 0; 2010 int n = 0, pid;
2011 struct cgroup_iter it; 2011 struct cgroup_iter it;
2012 struct task_struct *tsk; 2012 struct task_struct *tsk;
2013 cgroup_iter_start(cgrp, &it); 2013 cgroup_iter_start(cgrp, &it);
2014 while ((tsk = cgroup_iter_next(cgrp, &it))) { 2014 while ((tsk = cgroup_iter_next(cgrp, &it))) {
2015 if (unlikely(n == npids)) 2015 if (unlikely(n == npids))
2016 break; 2016 break;
2017 pidarray[n++] = task_pid_vnr(tsk); 2017 pid = task_pid_vnr(tsk);
2018 if (pid > 0)
2019 pidarray[n++] = pid;
2018 } 2020 }
2019 cgroup_iter_end(cgrp, &it); 2021 cgroup_iter_end(cgrp, &it);
2020 return n; 2022 return n;