From: Harshad Shirwadkar <harshadshirwadkar@xxxxxxxxx> Don't ignore return value of ext2fs_get_array() in ext2fs_count_blocks(). Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@xxxxxxxxx> --- lib/ext2fs/extent.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c index 1a87e68b..9e611038 100644 --- a/lib/ext2fs/extent.c +++ b/lib/ext2fs/extent.c @@ -1824,8 +1824,11 @@ errcode_t ext2fs_count_blocks(ext2_filsys fs, ext2_ino_t ino, if (errcode) goto out; - ext2fs_get_array(handle->max_depth, sizeof(blk64_t), - &intermediate_nodes); + errcode = ext2fs_get_array(handle->max_depth, sizeof(blk64_t), + &intermediate_nodes); + if (errcode) + goto out; + blkcount = handle->level; while (!errcode) { if (extent.e_flags & EXT2_EXTENT_FLAGS_LEAF) { -- 2.30.0.617.g56c4b15f3c-goog