提交 a658f3b1 编写于 作者: W Wang ShaoBo 提交者: Yang Yingliang

arm64/mpam: Fix compile warning

hulk inclusion
category: bugfix
bugzilla: 34278
CVE: NA

-------------------------------------------------

Set dentry before goto error handling branch.

fs/resctrlfs.c: In function ‘resctrl_mount’:
fs/resctrlfs.c:419:9: warning: ‘dentry’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  return dentry;
         ^~~~~~

Fixes: 67adc53a ("arm64/mpam: resctrl: Use resctrl_group_init_alloc() for default group")
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: NJian Cheng <cj.chengjian@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 238f08fe
...@@ -354,8 +354,10 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type, ...@@ -354,8 +354,10 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type,
} }
ret = resctrl_group_init_alloc(&resctrl_group_default); ret = resctrl_group_init_alloc(&resctrl_group_default);
if (ret < 0) if (ret < 0) {
dentry = ERR_PTR(ret);
goto out_schema; goto out_schema;
}
ret = resctrl_group_create_info_dir(resctrl_group_default.kn, &kn_info); ret = resctrl_group_create_info_dir(resctrl_group_default.kn, &kn_info);
if (ret) { if (ret) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册