Whamcloud - gitweb
ext2fs: don't ignore return value in ext2fs_count_blocks
authorHarshad Shirwadkar <harshadshirwadkar@gmail.com>
Tue, 23 Feb 2021 17:41:54 +0000 (09:41 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 23 Feb 2021 17:58:03 +0000 (12:58 -0500)
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>
lib/ext2fs/extent.c

index 1a87e68..9e61103 100644 (file)
@@ -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) {