diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index f337f42a07ac051e6ae54dda7cbed3bb9284752a..9d7264beb74f547a7b3031c242ddd0c3a6da0599 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1136,7 +1136,7 @@ static void update_nodemasks_hier(struct cpuset *cs, nodemask_t *new_mems)
 		mutex_unlock(&callback_mutex);
 
 		WARN_ON(!cgroup_on_dfl(cp->css.cgroup) &&
-			nodes_equal(cp->mems_allowed, cp->effective_mems));
+			!nodes_equal(cp->mems_allowed, cp->effective_mems));
 
 		update_tasks_nodemask(cp);