From 1b58bec0b9a1fbe9c3b5c0fba239b8091e1cee4a Mon Sep 17 00:00:00 2001 From: gaochao Date: Mon, 21 Feb 2022 19:59:01 +0800 Subject: [PATCH] bugfix of issue #I4UE7J category: bugfix issue: #I4UE7J CVE: NA Signed-off-by: gaochao ------------------------------------------- bugfix of issue #I4UE7J https://gitee.com/openharmony/kernel_linux_5.10/issues/I4UE7J?from=project-issue --- kernel/cgroup/cpuset.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index c33d70215079..3173fe47380a 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -1539,16 +1539,16 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, return retval; } - if (!cpumask_subset(trialcs->cpus_requested, top_cpuset.cpus_requested)) + if (!cpumask_subset(trialcs->cpus_requested, cpu_present_mask)) return -EINVAL; + cpumask_and(trialcs->cpus_allowed, trialcs->cpus_requested, + cpu_active_mask); + /* Nothing to do if the cpus didn't change */ if (cpumask_equal(cs->cpus_requested, trialcs->cpus_requested)) return 0; - cpumask_and(trialcs->cpus_allowed, trialcs->cpus_requested, - cpu_active_mask); - retval = validate_change(cs, trialcs); if (retval < 0) return retval; -- Gitee