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 224bec0..bc594d5 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;