]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cgroup: remove the superfluous judgment
authorShida Zhang <starzhangzsd@gmail.com>
Wed, 18 May 2022 01:36:47 +0000 (09:36 +0800)
committerTejun Heo <tj@kernel.org>
Fri, 20 May 2022 07:49:45 +0000 (21:49 -1000)
Remove the superfluous judgment since the function is
never called for a root cgroup, as suggested by Tejun.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
Reviewed-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c

index a97fd051430bd2e7173a6d83eb795d5a440d02c4..1779ccddb734d00c53f6968c3445aaf5314aebf6 100644 (file)
@@ -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);