btrfs: sysfs: normalize the error handling branch in btrfs_init_sysfs()
authorZhen Lei <thunder.leizhen@huawei.com>
Tue, 22 Nov 2022 11:50:02 +0000 (19:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:12 +0000 (17:41 +0100)
commitb8dc245909238dd665f1411a9f8d37851d7ff687
treef5ecd6c5ca67e82c639895b19eea1f47cea9d5ab
parent914baca57af7b9650686d73dbe6c1949c174fa12
btrfs: sysfs: normalize the error handling branch in btrfs_init_sysfs()

commit ffdbb44f2f23f963b8f5672e35c3a26088177a62 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/sysfs.c