mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-04 21:54:34 +00:00
Btrfs: return errno if possible when we fail to allocate memory
We need to set return value explicitly, otherwise we'll lose the error value. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
This commit is contained in:
parent
d88033dbf4
commit
b9aa55bed1
1 changed files with 6 additions and 2 deletions
|
@ -714,8 +714,10 @@ retry:
|
|||
async_extent->ram_size - 1, 0);
|
||||
|
||||
em = alloc_extent_map();
|
||||
if (!em)
|
||||
if (!em) {
|
||||
ret = -ENOMEM;
|
||||
goto out_free_reserve;
|
||||
}
|
||||
em->start = async_extent->start;
|
||||
em->len = async_extent->ram_size;
|
||||
em->orig_start = em->start;
|
||||
|
@ -922,8 +924,10 @@ static noinline int __cow_file_range(struct btrfs_trans_handle *trans,
|
|||
}
|
||||
|
||||
em = alloc_extent_map();
|
||||
if (!em)
|
||||
if (!em) {
|
||||
ret = -ENOMEM;
|
||||
goto out_reserve;
|
||||
}
|
||||
em->start = start;
|
||||
em->orig_start = em->start;
|
||||
ram_size = ins.offset;
|
||||
|
|
Loading…
Add table
Reference in a new issue