diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-12-05 17:25:32 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-26 09:42:47 +0100 |
commit | db0e91e3fe72b762fd2753336ebe043c9547c7ce (patch) | |
tree | b7fde9014574315bd9ff8f62e4210d79cc45c30b /fs | |
parent | b37804d039bf3417a2a5eb8840584be13a01f142 (diff) | |
download | linux-artik7-db0e91e3fe72b762fd2753336ebe043c9547c7ce.tar.gz linux-artik7-db0e91e3fe72b762fd2753336ebe043c9547c7ce.tar.bz2 linux-artik7-db0e91e3fe72b762fd2753336ebe043c9547c7ce.zip |
f2fs: free meta pages if sanity check for ckpt is failed
commit a2125ff7dd1ed3a2a53cdc1f8f9c9cec9cfaa7ab upstream.
This fixes missing freeing meta pages in the error case.
Tested-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/checkpoint.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index b5b8b38b1c66..f0576b82cbfa 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -708,7 +708,7 @@ int get_valid_checkpoint(struct f2fs_sb_info *sbi) /* Sanity checking of checkpoint */ if (sanity_check_ckpt(sbi)) - goto fail_no_cp; + goto free_fail_no_cp; if (cur_page == cp1) sbi->cur_cp_pack = 1; @@ -736,6 +736,9 @@ done: f2fs_put_page(cp2, 1); return 0; +free_fail_no_cp: + f2fs_put_page(cp1, 1); + f2fs_put_page(cp2, 1); fail_no_cp: kfree(sbi->ckpt); return -EINVAL; |