cgroup: leave cg_list valid upon cgroup_exit
authorSimon Wilson <simonwilson@google.com>
Sat, 8 Jan 2011 02:46:34 +0000 (18:46 -0800)
committerColin Cross <ccross@android.com>
Tue, 11 Jan 2011 00:16:51 +0000 (16:16 -0800)
commit78d2a8274115727ab3864584abee09d3021de9c6
tree0d4f5ed6fff1fff9568e3a5c65e9ab1168560727
parent5947e496b6dea68354785458a3bb07b5ca78ae85
cgroup: leave cg_list valid upon cgroup_exit

A thread/process in cgroup_attach_task() could have called
list_del(&tsk->cg_list) after cgroup_exit() had already called
list_del() on the same list. Since it only checked for
!list_empty(&tsk->cg_list) before doing this, the list_del()
call would thus be made twice.

The solution is to leave tsk->cg_list in a valid state in
cgroup_exit() with list_del_init(&tsk->cg_list), which leaves
an empty list.

Change-Id: I4e7c1d0665fced629f5ca033c18dd98afe080e0c
Signed-off-by: Simon Wilson <simonwilson@google.com>
kernel/cgroup.c