diff options
author | Harshad Shirwadkar <harshadshirwadkar@gmail.com> | 2021-02-23 09:41:54 -0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2021-02-23 12:58:03 -0500 |
commit | c5ff455e42d2f2715fe3245fa8c63c87f05af97c (patch) | |
tree | 95d07d24b5f528442c3fa6468887f38fe2f68904 | |
parent | 1e616535bc5e8e2edc10218f9a2db84efd9eb3c3 (diff) | |
download | e2fsprogs-c5ff455e42d2f2715fe3245fa8c63c87f05af97c.tar.gz |
ext2fs: don't ignore return value in ext2fs_count_blocks
Don't ignore return value of ext2fs_get_array() in
ext2fs_count_blocks().
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | lib/ext2fs/extent.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c index 1a87e68b9..9e6110382 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) { |