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



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

Reply via email to