Skip to content

Commit

Permalink
btrfs: dev stat drop useless goto
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anand Jain authored and David Sterba committed Sep 9, 2019
1 parent 440630e commit 3b80a98
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 3b80a98

Please sign in to comment.