diff options
author | Anand Jain <anand.jain@oracle.com> | 2019-08-21 05:26:32 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-09-09 08:59:12 -0400 |
commit | 3b80a984d2283e6f1dc59571e5aadc36eadac939 (patch) | |
tree | 1ab1569f9167e8421e09138834aec6bd615b4f3a | |
parent | 440630ea7c37d0f785aca4122ac9272d01ee36db (diff) |
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>
-rw-r--r-- | fs/btrfs/volumes.c | 7 |
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) | |||
7289 | int i; | 7289 | int i; |
7290 | 7290 | ||
7291 | path = btrfs_alloc_path(); | 7291 | path = btrfs_alloc_path(); |
7292 | if (!path) { | 7292 | if (!path) |
7293 | ret = -ENOMEM; | 7293 | return -ENOMEM; |
7294 | goto out; | ||
7295 | } | ||
7296 | 7294 | ||
7297 | mutex_lock(&fs_devices->device_list_mutex); | 7295 | mutex_lock(&fs_devices->device_list_mutex); |
7298 | list_for_each_entry(device, &fs_devices->devices, dev_list) { | 7296 | 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) | |||
7331 | } | 7329 | } |
7332 | mutex_unlock(&fs_devices->device_list_mutex); | 7330 | mutex_unlock(&fs_devices->device_list_mutex); |
7333 | 7331 | ||
7334 | out: | ||
7335 | btrfs_free_path(path); | 7332 | btrfs_free_path(path); |
7336 | return ret < 0 ? ret : 0; | 7333 | return ret < 0 ? ret : 0; |
7337 | } | 7334 | } |