summaryrefslogtreecommitdiff
path: root/fs/btrfs/sysfs.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-06-26 14:39:34 +0300
committerMark Brown <broonie@kernel.org>2019-06-26 14:39:34 +0300
commit53c8b29abe42e5601cfa0ea5962532f0cfdec8a0 (patch)
treecad53f42ce7a03c39a984bcdbcc42cd47f1af6f9 /fs/btrfs/sysfs.c
parente3303268f9cfa4eb7c2217df471417d4327109fd (diff)
parent4b972a01a7da614b4796475f933094751a295a2f (diff)
downloadlinux-53c8b29abe42e5601cfa0ea5962532f0cfdec8a0.tar.xz
Merge tag 'v5.2-rc6' into asoc-5.3
Linux 5.2-rc6
Diffstat (limited to 'fs/btrfs/sysfs.c')
-rw-r--r--fs/btrfs/sysfs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 5a5930e3d32b..2f078b77fe14 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -825,7 +825,12 @@ int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs,
fs_devs->fsid_kobj.kset = btrfs_kset;
error = kobject_init_and_add(&fs_devs->fsid_kobj,
&btrfs_ktype, parent, "%pU", fs_devs->fsid);
- return error;
+ if (error) {
+ kobject_put(&fs_devs->fsid_kobj);
+ return error;
+ }
+
+ return 0;
}
int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info)