linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 01/10] f2fs-tools: fix potential deadloop
@ 2019-08-09 10:52 Chao Yu
  2019-08-09 10:52 ` [f2fs-dev] [PATCH 02/10] f2fs-tools: fix to avoid memory leak of sit_i->sentries Chao Yu
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Chao Yu @ 2019-08-09 10:52 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-f2fs-devel

In error path of build_sit_info(), start variable is unsigned int type,
it should never be less than zero, fix it.

build_sit_info()
{
...
	unsigned int start;
...
free_validity_maps:
	for (--start ; start >= 0; --start)
		free(sit_i->sentries[start].cur_valid_map);
...
}

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 fsck/mount.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fsck/mount.c b/fsck/mount.c
index fd89b8e..f97c4ea 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -1401,7 +1401,8 @@ int build_sit_info(struct f2fs_sb_info *sbi)
 	struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi);
 	struct f2fs_checkpoint *cp = F2FS_CKPT(sbi);
 	struct sit_info *sit_i;
-	unsigned int sit_segs, start;
+	unsigned int sit_segs;
+	int start;
 	char *src_bitmap, *dst_bitmap;
 	unsigned int bitmap_size;
 
-- 
2.18.0.rc1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

end of thread, other threads:[~2019-08-09 10:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 10:52 [f2fs-dev] [PATCH 01/10] f2fs-tools: fix potential deadloop Chao Yu
2019-08-09 10:52 ` [f2fs-dev] [PATCH 02/10] f2fs-tools: fix to avoid memory leak of sit_i->sentries Chao Yu
2019-08-09 10:52 ` [f2fs-dev] [PATCH 03/10] f2fs-tools: allocate memory in batch in build_sit_info() Chao Yu
2019-08-09 10:52 ` [f2fs-dev] [PATCH 04/10] fsck.f2fs: introduce current_sit_addr() for cleanup Chao Yu
2019-08-09 10:52 ` [f2fs-dev] [PATCH 05/10] f2fs-tools: introduce f2fs_ra_meta_pages() Chao Yu
2019-08-09 10:52 ` [f2fs-dev] [PATCH 06/10] dump.f2fs: introduce start_bidx_of_node() for cleanup Chao Yu
2019-08-09 10:52 ` [f2fs-dev] [PATCH 07/10] fsck.f2fs: fix to set large section type during allocation Chao Yu
2019-08-09 10:53 ` [f2fs-dev] [PATCH 08/10] f2fs-tools: advise to mount unclean image to replay journal Chao Yu
2019-08-09 10:53 ` [f2fs-dev] [PATCH 09/10] fsck.f2fs: fix to propagate error of write_dquots() Chao Yu
2019-08-09 10:53 ` [f2fs-dev] [PATCH 10/10] f2fs-tools: add missing newline symbol in log Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).