Skip to content

Commit 98806b4

Browse files
Stefan Behrensmasoncl
authored andcommitted
btrfs: check_int: propagate out-of-memory error upwards
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 <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent 61391d5 commit 98806b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/btrfs/check-integrity.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,7 @@ static int btrfsic_process_metablock(
10931093
next_stack =
10941094
btrfsic_stack_frame_alloc();
10951095
if (NULL == next_stack) {
1096+
sf->error = -1;
10961097
btrfsic_release_block_ctx(
10971098
&sf->
10981099
next_block_ctx);
@@ -1190,8 +1191,10 @@ static int btrfsic_process_metablock(
11901191
sf->next_block_ctx.datav[0];
11911192

11921193
next_stack = btrfsic_stack_frame_alloc();
1193-
if (NULL == next_stack)
1194+
if (NULL == next_stack) {
1195+
sf->error = -1;
11941196
goto one_stack_frame_backwards;
1197+
}
11951198

11961199
next_stack->i = -1;
11971200
next_stack->block = sf->next_block;

0 commit comments

Comments
 (0)