From a581563f1bef035e4c8d634a1df26dae9140b115 Mon Sep 17 00:00:00 2001 From: Peng Wang Date: Wed, 3 Jul 2019 10:07:49 +0800 Subject: 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 Signed-off-by: Tejun Heo --- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel/cgroup') 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(); -- cgit v1.2.3