]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
btrfs: dev stat drop useless goto
authorAnand Jain <anand.jain@oracle.com>
Wed, 21 Aug 2019 09:26:32 +0000 (17:26 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:12 +0000 (14:59 +0200)
In the function btrfs_init_dev_stats() goto out is not needed, because the
alloc has failed. So just return -ENOMEM.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c

index 539071bdbf4fc2e0a985d19e1fc681f72650214e..48526923c17c9d5bb05d7555cc8b3ffbbae4667a 100644 (file)
@@ -7289,10 +7289,8 @@ int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info)
        int i;
 
        path = btrfs_alloc_path();
-       if (!path) {
-               ret = -ENOMEM;
-               goto out;
-       }
+       if (!path)
+               return -ENOMEM;
 
        mutex_lock(&fs_devices->device_list_mutex);
        list_for_each_entry(device, &fs_devices->devices, dev_list) {
@@ -7331,7 +7329,6 @@ int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info)
        }
        mutex_unlock(&fs_devices->device_list_mutex);
 
-out:
        btrfs_free_path(path);
        return ret < 0 ? ret : 0;
 }