btrfs-progs: catch memory allocation failure in btrfs_split_item
authorDavid Sterba <dsterba@suse.com>
Wed, 6 Jan 2016 14:52:11 +0000 (15:52 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 12 Jan 2016 14:02:51 +0000 (15:02 +0100)
Do the dumb BUG_ON now, the function needs more changes to handle all
errors.

Signed-off-by: David Sterba <dsterba@suse.com>
ctree.c

diff --git a/ctree.c b/ctree.c
index 46153e3..04cc476 100644 (file)
--- 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;