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: eb870a0d4e33 ("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 Signed-off-by: Cheng Jian cj.chengjian@huawei.com --- fs/resctrlfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/resctrlfs.c b/fs/resctrlfs.c index 7779d6ec3e27..532b944e922c 100644 --- a/fs/resctrlfs.c +++ b/fs/resctrlfs.c @@ -354,8 +354,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) {