btrfs: check_int: propagate out-of-memory error upwards
authorStefan Behrens <sbehrens@giantdisaster.de>
Fri, 9 May 2014 13:28:07 +0000 (15:28 +0200)
committerChris Mason <clm@fb.com>
Tue, 10 Jun 2014 00:20:21 +0000 (17:20 -0700)
This issue was not causing any harm but IMO (and in the opinion of the
static code checker) it is better to propagate this error status upwards.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/check-integrity.c

index 0e8388e72d8d0c7dd3884a0d0ff7e8cabf120fbb..ce92ae30250fb256fbbbdb9158315c757a24adc1 100644 (file)
@@ -1093,6 +1093,7 @@ leaf_item_out_of_bounce_error:
                                        next_stack =
                                            btrfsic_stack_frame_alloc();
                                        if (NULL == next_stack) {
+                                               sf->error = -1;
                                                btrfsic_release_block_ctx(
                                                                &sf->
                                                                next_block_ctx);
@@ -1190,8 +1191,10 @@ continue_with_current_node_stack_frame:
                                    sf->next_block_ctx.datav[0];
 
                                next_stack = btrfsic_stack_frame_alloc();
-                               if (NULL == next_stack)
+                               if (NULL == next_stack) {
+                                       sf->error = -1;
                                        goto one_stack_frame_backwards;
+                               }
 
                                next_stack->i = -1;
                                next_stack->block = sf->next_block;