lkml.org 
[lkml]   [2022]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] btrfs: fix a resource leak in btrfs_init_sysfs()
From


On 2022/11/19 14:43, Zhen Lei wrote:
> When btrfs_debug_feature_attr_group fails to be created,
> btrfs_feature_attr_group is not removed.
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
> fs/btrfs/sysfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
> index 699b54b3acaae0b..947125f2ceaaf96 100644
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -2322,7 +2322,7 @@ 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;
> + goto out_remove_group;
> #endif
>
> return 0;

\
 
 \ /
  Last update: 2022-11-19 07:53    [W:2.041 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site