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>
This commit is contained in:
committed by
Chris Mason
parent
43e817a1fd
commit
8d413713ca
@@ -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,
|
||||
|
Reference in New Issue
Block a user