summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2011-04-25 19:43:52 -0400
committerChris Mason <chris.mason@oracle.com>2011-04-25 19:43:52 -0400
commit8d413713ca744fa00cf4e05d4054d80727b84789 (patch)
treedf29b480d83806cd4e85508ac676eb69323ddc79 /fs/btrfs/extent-tree.c
parent43e817a1fdda17f3357602ed7964c248c8c53ae0 (diff)
downloadop-kernel-dev-8d413713ca744fa00cf4e05d4054d80727b84789.zip
op-kernel-dev-8d413713ca744fa00cf4e05d4054d80727b84789.tar.gz
Btrfs: check return value of kmalloc()
The check on the return value of kmalloc() is added to some places. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 31f33ba..cd52f7f 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -8059,6 +8059,10 @@ static noinline int relocate_one_extent(struct btrfs_root *extent_root,
u64 group_start = group->key.objectid;
new_extents = kmalloc(sizeof(*new_extents),
GFP_NOFS);
+ if (!new_extents) {
+ ret = -ENOMEM;
+ goto out;
+ }
nr_extents = 1;
ret = get_new_locations(reloc_inode,
extent_key,
OpenPOWER on IntegriCloud