diff options
author | Tejun Heo <tj@kernel.org> | 2014-05-13 17:28:30 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-05-13 17:28:30 +0200 |
commit | 36e9d2ebcc15d029b33f42a36146ab5a5bcfcfe7 (patch) | |
tree | 8de644b8fb941ee475163b59ad76506a647a9d85 /kernel/cgroup_freezer.c | |
parent | cgroup_freezer: replace freezer->lock with freezer_mutex (diff) | |
download | linux-36e9d2ebcc15d029b33f42a36146ab5a5bcfcfe7.tar.xz linux-36e9d2ebcc15d029b33f42a36146ab5a5bcfcfe7.zip |
cgroup: fix rcu_read_lock() leak in update_if_frozen()
While updating cgroup_freezer locking, 68fafb77d827 ("cgroup_freezer:
replace freezer->lock with freezer_mutex") introduced a bug in
update_if_frozen() where it returns with rcu_read_lock() held. Fix it
by adding rcu_read_unlock() before returning.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Diffstat (limited to 'kernel/cgroup_freezer.c')
-rw-r--r-- | kernel/cgroup_freezer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index 12ead0b766ee..345628c78b5b 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c @@ -267,8 +267,10 @@ static void update_if_frozen(struct cgroup_subsys_state *css) struct freezer *child = css_freezer(pos); if ((child->state & CGROUP_FREEZER_ONLINE) && - !(child->state & CGROUP_FROZEN)) + !(child->state & CGROUP_FROZEN)) { + rcu_read_unlock(); return; + } } rcu_read_unlock(); |