mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
fs/resctrl: Tidy up the error path in resctrl_mkdir_event_configs()
The error path in resctrl_mkdir_event_configs() is unnecessarily complicated. Simplify it to just return directly on error. Signed-off-by: Ben Horgan <ben.horgan@arm.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Babu Moger <babu.moger@amd.com> Tested-by: Babu Moger <babu.moger@amd.com> Link: https://lore.kernel.org/r/20260506082855.3694761-1-ben.horgan@arm.com
This commit is contained in:
parent
7fd2df204f
commit
7625632fed
|
|
@ -2331,22 +2331,19 @@ static int resctrl_mkdir_event_configs(struct rdt_resource *r, struct kernfs_nod
|
|||
continue;
|
||||
|
||||
kn_subdir2 = kernfs_create_dir(kn_subdir, mevt->name, kn_subdir->mode, mevt);
|
||||
if (IS_ERR(kn_subdir2)) {
|
||||
ret = PTR_ERR(kn_subdir2);
|
||||
goto out;
|
||||
}
|
||||
if (IS_ERR(kn_subdir2))
|
||||
return PTR_ERR(kn_subdir2);
|
||||
|
||||
ret = rdtgroup_kn_set_ugid(kn_subdir2);
|
||||
if (ret)
|
||||
goto out;
|
||||
return ret;
|
||||
|
||||
ret = rdtgroup_add_files(kn_subdir2, RFTYPE_ASSIGN_CONFIG);
|
||||
if (ret)
|
||||
break;
|
||||
return ret;
|
||||
}
|
||||
|
||||
out:
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rdtgroup_mkdir_info_resdir(void *priv, char *name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user