From: Liu Bo Date: Tue, 14 May 2013 02:12:15 +0000 (+0000) Subject: Btrfs: return errno if possible when we fail to allocate memory X-Git-Tag: v3.10-rc2~7^2^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9aa55bed1c1a3a329da31884b643c62d57ebb21;p=platform%2Fupstream%2Fkernel-adaptation-pc.git 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 Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 1669c3b..99a9c25 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -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;