]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: send: simplify return logic from fs_path_prepare_for_add()
authorFilipe Manana <fdmanana@suse.com>
Wed, 5 Feb 2025 11:50:48 +0000 (11:50 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Mar 2025 19:35:45 +0000 (20:35 +0100)
There is no need to have an 'out' label and jump into it since there are
no resource cleanups to perform (release locks, free memory, etc), so
make this simpler by removing the label and goto and instead return
directly.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/send.c

index 9f9885dc1e10a0eadda423c57cd4fbf17777a42c..535384028cb85a5c104cf2b4a885c66ce0d183da 100644 (file)
@@ -535,7 +535,7 @@ static int fs_path_prepare_for_add(struct fs_path *p, int name_len,
                new_len++;
        ret = fs_path_ensure_buf(p, new_len);
        if (ret < 0)
-               goto out;
+               return ret;
 
        if (p->reversed) {
                if (p->start != p->end)
@@ -550,8 +550,7 @@ static int fs_path_prepare_for_add(struct fs_path *p, int name_len,
                *p->end = 0;
        }
 
-out:
-       return ret;
+       return 0;
 }
 
 static int fs_path_add(struct fs_path *p, const char *name, int name_len)