Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <sbehrens@giantdisaster.de>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>

authored by

Stefan Behrens and committed by
Chris Mason
98806b44 61391d56

+4 -1
+4 -1
fs/btrfs/check-integrity.c
··· 1093 1093 next_stack = 1094 1094 btrfsic_stack_frame_alloc(); 1095 1095 if (NULL == next_stack) { 1096 + sf->error = -1; 1096 1097 btrfsic_release_block_ctx( 1097 1098 &sf-> 1098 1099 next_block_ctx); ··· 1191 1190 sf->next_block_ctx.datav[0]; 1192 1191 1193 1192 next_stack = btrfsic_stack_frame_alloc(); 1194 - if (NULL == next_stack) 1193 + if (NULL == next_stack) { 1194 + sf->error = -1; 1195 1195 goto one_stack_frame_backwards; 1196 + } 1196 1197 1197 1198 next_stack->i = -1; 1198 1199 next_stack->block = sf->next_block;