mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 13:51:44 +00:00
btrfs: sysfs: normalize the error handling branch in btrfs_init_sysfs()
Although kset_unregister() can eventually remove all attribute files, explicitly rolling back with the matching function makes the code logic look clearer. CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
796787c978
commit
ffdbb44f2f
@ -2321,8 +2321,11 @@ int __init btrfs_init_sysfs(void)
|
||||
|
||||
#ifdef CONFIG_BTRFS_DEBUG
|
||||
ret = sysfs_create_group(&btrfs_kset->kobj, &btrfs_debug_feature_attr_group);
|
||||
if (ret)
|
||||
goto out2;
|
||||
if (ret) {
|
||||
sysfs_unmerge_group(&btrfs_kset->kobj,
|
||||
&btrfs_static_feature_attr_group);
|
||||
goto out_remove_group;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user