linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] resize.f2fs: fix memory leak caused by migrate_nat()
       [not found] <CGME20210507110037epcas1p4921563aaef2122e35118e77d1852652c@epcas1p4.samsung.com>
@ 2021-05-07 11:03 ` Seung-Woo Kim
       [not found]   ` <CGME20210507110037epcas1p2da2c78057f68167196bf68cd35604bad@epcas1p2.samsung.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Seung-Woo Kim @ 2021-05-07 11:03 UTC (permalink / raw)
  To: aegeuk, linux-f2fs-devel; +Cc: linux-kernel, chao, sw0312.kim

Alloced nat_block doesn't freed from migrate_nat(). Fix to free
nat_block.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
---
 fsck/resize.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fsck/resize.c b/fsck/resize.c
index b043cd984dc6..78d578ec2cc1 100644
--- a/fsck/resize.c
+++ b/fsck/resize.c
@@ -383,6 +383,7 @@ static void migrate_nat(struct f2fs_sb_info *sbi,
 		ASSERT(ret >= 0);
 		DBG(3, "Write NAT: %lx\n", block_addr);
 	}
+	free(nat_block);
 	DBG(0, "Info: Done to migrate NAT blocks: nat_blkaddr = 0x%x -> 0x%x\n",
 			old_nat_blkaddr, new_nat_blkaddr);
 }
-- 
2.19.2


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

* [PATCH 2/2] mkfs.f2fs: fix memory leak in not enough segments error path
       [not found]   ` <CGME20210507110037epcas1p2da2c78057f68167196bf68cd35604bad@epcas1p2.samsung.com>
@ 2021-05-07 11:03     ` Seung-Woo Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Seung-Woo Kim @ 2021-05-07 11:03 UTC (permalink / raw)
  To: aegeuk, linux-f2fs-devel; +Cc: linux-kernel, chao, sw0312.kim

In not enough segements error path of f2fs_write_check_point_pack(),
cp_payload is not freed. Fix the error path.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
---
 mkfs/f2fs_format.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index 3f1fa32a407a..fbecb05b3302 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -723,7 +723,7 @@ static int f2fs_write_check_point_pack(void)
 
 	if (f2fs_get_usable_segments(sb) <= get_cp(overprov_segment_count)) {
 		MSG(0, "\tError: Not enough segments to create F2FS Volume\n");
-		goto free_nat_bits;
+		goto free_cp_payload;
 	}
 	MSG(0, "Info: Overprovision ratio = %.3lf%%\n", c.overprovision);
 	MSG(0, "Info: Overprovision segments = %u (GC reserved = %u)\n",
-- 
2.19.2


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

end of thread, other threads:[~2021-05-07 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210507110037epcas1p4921563aaef2122e35118e77d1852652c@epcas1p4.samsung.com>
2021-05-07 11:03 ` [PATCH 1/2] resize.f2fs: fix memory leak caused by migrate_nat() Seung-Woo Kim
     [not found]   ` <CGME20210507110037epcas1p2da2c78057f68167196bf68cd35604bad@epcas1p2.samsung.com>
2021-05-07 11:03     ` [PATCH 2/2] mkfs.f2fs: fix memory leak in not enough segments error path Seung-Woo 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).