From: Xie XiuQi <xiexiuqi(a)huawei.com>
commit 6c712a877e7e00c6cd47d581f223fd5ded6efcff openEuler-1.0
hulk inclusion
category: bugfix
bugzilla: 14212
CVE: NA
Only add a new domain to domain list, don't care about exist domain
node.
Signed-off-by: Xie XiuQi <xiexiuqi(a)huawei.com>
Reviewed-by: Hanjun Guo <guohanjun(a)huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com>
Signed-off-by: Xin Hao <haoxing990(a)gmail.com>
---
arch/arm64/kernel/mpam.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/mpam.c b/arch/arm64/kernel/mpam.c
index a83b43c9dcaa..c38c13bde995 100644
--- a/arch/arm64/kernel/mpam.c
+++ b/arch/arm64/kernel/mpam.c
@@ -1208,6 +1208,8 @@ static void mpam_domains_init(struct resctrl_resource *r)
if (!d)
d = kzalloc(sizeof(*d), GFP_KERNEL);
+ else
+ continue;
if (!d) {
mpam_domains_destroy(r);
@@ -1263,7 +1265,8 @@ static void mpam_domains_init(struct resctrl_resource *r)
return;
}
- list_add_tail(&d->list, add_pos);
+ if (add_pos)
+ list_add_tail(&d->list, add_pos);
id++;
}
--
2.31.0