btrfs-progs: catch memory allocation failure in splice_shared_node
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:50 +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>
cmds-check.c

index 224bec069ba07680f2797105b74f04de04a4c5fb..bc594d57efd877badf48f6e47e2fd2c503f082a2 100644 (file)
@@ -1128,6 +1128,7 @@ again:
                        ins = node;
                } else {
                        ins = malloc(sizeof(*ins));
+                       BUG_ON(!ins);
                        ins->cache.start = node->cache.start;
                        ins->cache.size = node->cache.size;
                        ins->data = rec;