linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] fsck.f2fs: free cp_page_1 in validate_checkpoint
@ 2016-09-29 10:38 Junling Zheng
  2016-09-29 10:38 ` [PATCH 2/4] fsck.f2fs: fix incorrect ERR_MSG in f2fs_do_mount Junling Zheng
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Junling Zheng @ 2016-09-29 10:38 UTC (permalink / raw)
  To: linux-f2fs-devel

Free cp_page_1 in validate_checkpoint to avoid memory leak.

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
---
 fsck/mount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fsck/mount.c b/fsck/mount.c
index 3be60bb..e390b26 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -494,7 +494,7 @@ void *validate_checkpoint(struct f2fs_sb_info *sbi, block_t cp_addr,
 	/* Read the 1st cp block in this CP pack */
 	cp_page_1 = malloc(PAGE_SIZE);
 	if (dev_read_block(cp_page_1, cp_addr) < 0)
-		return NULL;
+		goto invalid_cp1;
 
 	cp = (struct f2fs_checkpoint *)cp_page_1;
 	crc_offset = get_cp(checksum_offset);
-- 
2.7.4


------------------------------------------------------------------------------

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

end of thread, other threads:[~2016-10-10 16:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-29 10:38 [PATCH 1/4] fsck.f2fs: free cp_page_1 in validate_checkpoint Junling Zheng
2016-09-29 10:38 ` [PATCH 2/4] fsck.f2fs: fix incorrect ERR_MSG in f2fs_do_mount Junling Zheng
2016-09-29 10:38 ` [PATCH 3/4] fsck.f2fs: fix a typo in check_sector_size Junling Zheng
2016-09-29 10:38 ` [PATCH 4/4] f2fs: unify the length of versions Junling Zheng
2016-09-30 16:25   ` Jaegeuk Kim
2016-10-08  1:08     ` Junling Zheng
2016-10-10 16:49       ` Jaegeuk Kim

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).