mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-11 03:31:17 +00:00
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>
This commit is contained in:
parent
1669d8afa6
commit
8a9c9adbe5
@ -3255,7 +3255,7 @@ int btrfs_read_block_groups(struct btrfs_root *root)
|
|||||||
cache = kzalloc(sizeof(*cache), GFP_NOFS);
|
cache = kzalloc(sizeof(*cache), GFP_NOFS);
|
||||||
if (!cache) {
|
if (!cache) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
break;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
read_extent_buffer(leaf, &cache->item,
|
read_extent_buffer(leaf, &cache->item,
|
||||||
|
Loading…
Reference in New Issue
Block a user