fsck.f2fs: do umount to free memory in out_err
PATCH 1/1 fsck.f2fs: do umount to free memory in out_err
Call f2fs_do_umount to free memory in out_err branch.
Signed-off-by Junling Zheng <[email protected]>
--- fsck/main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
fsck/main.c +1 -4
@@ -844,9 +844,6 @@ retry:return 0 ; out_err: -if (sbi->ckpt) -free (sbi->ckpt); -if (sbi->raw_super) -free (sbi->raw_super); +f2fs_do_umount (sbi);return ret; }
Signature · 6 lines
2.16.2 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Sorry, this patch has a bug:
If f2fs_do_mount fails in validate_super_block or get_valid_checkpoint, then we should only free sbi->ckpt and sbi->raw_super :(
Quoted 13 lines · Junling Zheng
Call
f2fs_do_umountto free memory inout_errbranch.Signed-off-by Junling Zheng <[email protected]>--- fsck/main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)fsck/main.c +0
-0
fsck/main.c retry: · line 849
Quoted 10 lines
fsck/main.c +1
-4@@ -844,9 +844,6 @@ retry:return 0 ; out_err: -if (sbi->ckpt) -free (sbi->ckpt); -if (sbi->raw_super) -free (sbi->raw_super); +f2fs_do_umount (sbi);return ret; }
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot