public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ext2fs: initialize handle to NULL in ext2fs_count_blks
@ 2021-02-04 23:35 Harshad Shirwadkar
  2021-02-04 23:36 ` [PATCH 2/3] e2fsck: don't print errcode if the errcode is 0 Harshad Shirwadkar
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Harshad Shirwadkar @ 2021-02-04 23:35 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, Harshad Shirwadkar

From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>

Initialize the handle to NULL to ensure that in error cases,
ext2fs_free_mem can be called on it.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
---
 lib/ext2fs/extent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
index bde6b0f3..1a87e68b 100644
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -1809,7 +1809,7 @@ errcode_t ext2fs_decode_extent(struct ext2fs_extent *to, void *addr, int len)
 errcode_t ext2fs_count_blocks(ext2_filsys fs, ext2_ino_t ino,
 			      struct ext2_inode *inode, blk64_t *ret_count)
 {
-	ext2_extent_handle_t	handle;
+	ext2_extent_handle_t	handle = NULL;
 	struct ext2fs_extent	extent;
 	errcode_t		errcode;
 	int			i;
-- 
2.30.0.365.g02bc693789-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-09  4:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-04 23:35 [PATCH 1/3] ext2fs: initialize handle to NULL in ext2fs_count_blks Harshad Shirwadkar
2021-02-04 23:36 ` [PATCH 2/3] e2fsck: don't print errcode if the errcode is 0 Harshad Shirwadkar
2021-02-09  4:48   ` Theodore Ts'o
2021-02-04 23:36 ` [PATCH 3/3] e2fsck: endianness fixes for fast commit replay Harshad Shirwadkar
2021-02-09  4:49   ` Theodore Ts'o
2021-02-09  4:47 ` [PATCH 1/3] ext2fs: initialize handle to NULL in ext2fs_count_blks Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox