diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2011-04-25 19:43:52 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-04-25 19:43:52 -0400 |
commit | 8d413713ca744fa00cf4e05d4054d80727b84789 (patch) | |
tree | df29b480d83806cd4e85508ac676eb69323ddc79 /fs/btrfs/extent-tree.c | |
parent | 43e817a1fdda17f3357602ed7964c248c8c53ae0 (diff) | |
download | op-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.c | 4 |
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, |