btrfs-progs: return -ENOMEM properly in btrfs_read_block_groups()

Breaking from the while loop makes ret overwritten to zero, goto error
label directly and return -ENOMEM.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
master
Eryu Guan 2015-10-19 19:38:00 +08:00 committed by David Sterba
parent 1669d8afa6
commit 8a9c9adbe5
1 changed files with 1 additions and 1 deletions

View File

@ -3255,7 +3255,7 @@ int btrfs_read_block_groups(struct btrfs_root *root)
cache = kzalloc(sizeof(*cache), GFP_NOFS);
if (!cache) {
ret = -ENOMEM;
break;
goto error;
}
read_extent_buffer(leaf, &cache->item,