Skip to contentSkip to conversation

fuse: remove unnecessary goto

PATCH In review Yangtao Li 2 participants 2 messages Apr 6, 2023 – Apr 7, 2023

Subsystems (2)
lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 fuse: remove unnecessary goto

In this case, the error code can be returned directly.

---
 fs/fuse/inode.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
fs/fuse/inode.c +2 -5
index d66070af145d..56efcf160513 100644
@@ -1921,10 +1921,8 @@ static int fuse_sysfs_init(void)
 	int err;
 
 	fuse_kobj = kobject_create_and_add("fuse", fs_kobj);
-	if (!fuse_kobj) {
-		err = -ENOMEM;
-		goto out_err;
-	}
+	if (!fuse_kobj)
+		return -ENOMEM;
 
 	err = sysfs_create_mount_point(fuse_kobj, "connections");
 	if (err)
@@ -1934,7 +1932,6 @@ static int fuse_sysfs_init(void)
 
  out_fuse_unregister:
 	kobject_put(fuse_kobj);
- out_err:
 	return err;
 }
 
Signature · 1 line
2.35.1
#1 lore raw
Quoted 35 lines · Yangtao Li

In this case, the error code can be returned directly.

---
fs/fuse/inode.c | 7 ++-----

1 file changed, 2 insertions(+), 5 deletions(-)
fs/fuse/inode.c +2 -5
index d66070af145d..56efcf160513 100644
@@ -1921,10 +1921,8 @@ static int fuse_sysfs_init(void)
 	int err;
 
 	fuse_kobj = kobject_create_and_add("fuse", fs_kobj);
-	if (!fuse_kobj) {
-		err = -ENOMEM;
-		goto out_err;
-	}
+	if (!fuse_kobj)
+		return -ENOMEM;
 
 	err = sysfs_create_mount_point(fuse_kobj, "connections");
 	if (err)
@@ -1934,7 +1932,6 @@ static int fuse_sysfs_init(void)
 
 out_fuse_unregister:
 	kobject_put(fuse_kobj);
- out_err:
 	return err;
 }
 
Signature · 1 line
2.35.1

Reviewed by: Nitesh Shetty <[email protected]>