summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2019-08-21 17:26:32 +0800
committerDavid Sterba <dsterba@suse.com>2019-09-09 14:59:12 +0200
commit3b80a984d2283e6f1dc59571e5aadc36eadac939 (patch)
tree1ab1569f9167e8421e09138834aec6bd615b4f3a /fs/btrfs/volumes.c
parent440630ea7c37d0f785aca4122ac9272d01ee36db (diff)
downloadlinux-stable-3b80a984d2283e6f1dc59571e5aadc36eadac939.tar.gz
linux-stable-3b80a984d2283e6f1dc59571e5aadc36eadac939.tar.bz2
linux-stable-3b80a984d2283e6f1dc59571e5aadc36eadac939.zip
btrfs: dev stat drop useless goto
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>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 539071bdbf4f..48526923c17c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -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;
}