Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] btrfs: Fix error code in btrfs_sysfs_add_mounted()
@ 2020-01-10  5:51 Dan Carpenter
  2020-01-10  9:13 ` Anand Jain
  2020-01-10 17:06 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-01-10  5:51 UTC (permalink / raw)
  To: Chris Mason, Dennis Zhou
  Cc: Josef Bacik, David Sterba, Anand Jain, linux-btrfs,
	kernel-janitors

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@oracle.com>
---
 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;
 		goto failure;
+	}
 
 	error = sysfs_create_files(fs_info->debug_kobj, btrfs_debug_mount_attrs);
 	if (error)
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-10 17:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-10  5:51 [PATCH] btrfs: Fix error code in btrfs_sysfs_add_mounted() Dan Carpenter
2020-01-10  9:13 ` Anand Jain
2020-01-10 17:06 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox