summaryrefslogtreecommitdiff
path: root/kernel/cgroup/cgroup.c
diff options
context:
space:
mode:
authorPeng Wang <rocking@whu.edu.cn>2019-07-03 10:07:49 +0800
committerTejun Heo <tj@kernel.org>2019-07-23 15:46:33 -0700
commita581563f1bef035e4c8d634a1df26dae9140b115 (patch)
treec2f3d467fc72ee254abcbeeca6015b21fa0ebe80 /kernel/cgroup/cgroup.c
parent85db0023376f529c477c6110043e069ccee16d9c (diff)
downloadlwn-a581563f1bef035e4c8d634a1df26dae9140b115.tar.gz
lwn-a581563f1bef035e4c8d634a1df26dae9140b115.zip
cgroup: minor tweak for logic to get cgroup css
We could only handle the case that css exists and css_try_get_online() fails. Signed-off-by: Peng Wang <rocking@whu.edu.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup/cgroup.c')
-rw-r--r--kernel/cgroup/cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 3c3d92d993e8..21ddf3053235 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -488,7 +488,7 @@ static struct cgroup_subsys_state *cgroup_tryget_css(struct cgroup *cgrp,
rcu_read_lock();
css = cgroup_css(cgrp, ss);
- if (!css || !css_tryget_online(css))
+ if (css && !css_tryget_online(css))
css = NULL;
rcu_read_unlock();