From: David Sterba Date: Wed, 6 Jan 2016 14:52:11 +0000 (+0100) Subject: btrfs-progs: catch memory allocation failure in btrfs_split_item X-Git-Tag: upstream/4.16.1~1797 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b98ad87a037c053da533d7d9929583b9ea42c86c;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: catch memory allocation failure in btrfs_split_item Do the dumb BUG_ON now, the function needs more changes to handle all errors. Signed-off-by: David Sterba --- diff --git a/ctree.c b/ctree.c index 46153e3..04cc476 100644 --- a/ctree.c +++ b/ctree.c @@ -2243,6 +2243,7 @@ split: buf = kmalloc(item_size, GFP_NOFS); + BUG_ON(!buf); read_extent_buffer(leaf, buf, btrfs_item_ptr_offset(leaf, path->slots[0]), item_size); slot = path->slots[0] + 1;