On 10/1/20 1:51 PM, Dan Carpenter wrote:
The error code wasn't set on this error path.
>
Fixes: e12ebce8a4a8 ("btrfs: sysfs: make UUID/debug have its own kobject")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
fs/btrfs/sysfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 58486229be95..55e4ed1af29c 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -1288,8 +1288,10 @@ int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info)
#ifdef CONFIG_BTRFS_DEBUG
fs_info->debug_kobj = kobject_create_and_add("debug", fsid_kobj);
- if (!fs_info->debug_kobj)
+ if (!fs_info->debug_kobj) {
+ error = -ENOMEM;
uh-oh right.
Reviewed-by: Anand Jain <anand.jain@xxxxxxxxxx>
Thanks, Anand
goto failure;
+ }
error = sysfs_create_files(fs_info->debug_kobj, btrfs_debug_mount_attrs);
if (error)