Skip to content

Commit

Permalink
cgroup: fix rcu_read_lock() leak in update_if_frozen()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
htejun committed May 13, 2014
1 parent e5ced8e commit 36e9d2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/cgroup_freezer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 36e9d2e

Please sign in to comment.