Commit 96a2b48e authored by Yafang Shao's avatar Yafang Shao Committed by Tejun Heo
Browse files

cgroup: Remove unnecessary list_empty()



The root hasn't been removed from the root_list, so the list can't be NULL.
However, if it had been removed, attempting to destroy it once more is not
possible. Let's replace this with WARN_ON_ONCE() for clarity.

Signed-off-by: default avatarYafang Shao <laoar.shao@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent a12deb44
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1347,10 +1347,9 @@ static void cgroup_destroy_root(struct cgroup_root *root)

	spin_unlock_irq(&css_set_lock);

	if (!list_empty(&root->root_list)) {
	WARN_ON_ONCE(list_empty(&root->root_list));
	list_del(&root->root_list);
	cgroup_root_count--;
	}

	if (!have_favordynmods)
		cgroup_favor_dynmods(root, false);