From: Wang ShaoBo bobo.shaobowang@huawei.com
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: 1b70f98921b10 ("arm64/mpam: resctrl: Use resctrl_group_init_alloc() for default group") Signed-off-by: Wang ShaoBo bobo.shaobowang@huawei.com Reviewed-by: Jian Cheng cj.chengjian@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- fs/resctrlfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/resctrlfs.c b/fs/resctrlfs.c index 190ad509714d5..df47b105609b9 100644 --- a/fs/resctrlfs.c +++ b/fs/resctrlfs.c @@ -351,8 +351,10 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type, }
ret = resctrl_group_init_alloc(&resctrl_group_default); - if (ret < 0) + if (ret < 0) { + dentry = ERR_PTR(ret); goto out_schema; + }
ret = resctrl_group_create_info_dir(resctrl_group_default.kn, &kn_info); if (ret) {