Unverified Commit 27d5cc06 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14457 cgroup: Fix potential overflow issue when checking max_depth

parents 6883c2cf e9f60ba0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5623,7 +5623,7 @@ static bool cgroup_check_hierarchy_limits(struct cgroup *parent)
{
	struct cgroup *cgroup;
	int ret = false;
	int level = 1;
	int level = 0;

	lockdep_assert_held(&cgroup_mutex);

@@ -5631,7 +5631,7 @@ static bool cgroup_check_hierarchy_limits(struct cgroup *parent)
		if (cgroup->nr_descendants >= cgroup->max_descendants)
			goto fail;

		if (level > cgroup->max_depth)
		if (level >= cgroup->max_depth)
			goto fail;

		level++;