[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210223174156.308507-2-harshads@google.com>
Date: Tue, 23 Feb 2021 09:41:54 -0800
From: Harshad Shirwadkar <harshadshirwadkar@...il.com>
To: linux-ext4@...r.kernel.org
Cc: tytso@....edu, Harshad Shirwadkar <harshadshirwadkar@...il.com>
Subject: [PATCH v2 2/4] ext2fs: don't ignore return value in ext2fs_count_blocks
From: Harshad Shirwadkar <harshadshirwadkar@...il.com>
Don't ignore return value of ext2fs_get_array() in
ext2fs_count_blocks().
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@...il.com>
---
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
Powered by blists - more mailing lists