From: Shida Zhang Date: Wed, 18 May 2022 01:36:47 +0000 (+0800) Subject: cgroup: remove the superfluous judgment X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b154a017c92011d8f71ce804583e5f9c3d90bb9a;p=linux.git cgroup: remove the superfluous judgment Remove the superfluous judgment since the function is never called for a root cgroup, as suggested by Tejun. Suggested-by: Tejun Heo Signed-off-by: Shida Zhang Reviewed-by: Michal Koutný Signed-off-by: Tejun Heo --- diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index a97fd051430b..1779ccddb734 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -5685,7 +5685,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) css_clear_dir(&cgrp->self); kernfs_remove(cgrp->kn); - if (parent && cgroup_is_threaded(cgrp)) + if (cgroup_is_threaded(cgrp)) parent->nr_threaded_children--; spin_lock_irq(&css_set_lock);