From: Xie XiuQi <xiexiuqi(a)huawei.com>
commit 794555b36a5200c901c1abc5db9612f6ec451b58 openEuler-1.0
hulk inclusion
category: feature
bugzilla: 5510
CVE: NA
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>
---
fs/resctrlfs.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/resctrlfs.c b/fs/resctrlfs.c
index 785ff1031ada..6d685371181b 100644
--- a/fs/resctrlfs.c
+++ b/fs/resctrlfs.c
@@ -559,7 +559,12 @@ static int mkdir_resctrl_prepare(struct kernfs_node *parent_kn,
if (resctrl_mon_capable) {
#ifdef CONFIG_ARM64
- resctrl_mkdir_ctrlmon_mondata(kn, rdtgrp, &rdtgrp->mon.mon_data_kn);
+ ret = resctrl_mkdir_ctrlmon_mondata(kn, rdtgrp, &rdtgrp->mon.mon_data_kn);
+ if (ret < 0) {
+ rdt_last_cmd_puts("out of monitors or PMGs\n");
+ goto out_destroy;
+ }
+
#else
ret = alloc_mon_id();
if (ret < 0) {
--
2.31.0