projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2040fce
)
f2fs: free meta pages if sanity check for ckpt is failed
author
Jaegeuk Kim
<jaegeuk@kernel.org>
Tue, 6 Dec 2016 01:25:32 +0000
(17:25 -0800)
committer
Jaegeuk Kim
<jaegeuk@kernel.org>
Wed, 7 Dec 2016 22:38:16 +0000
(14:38 -0800)
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>
fs/f2fs/checkpoint.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/f2fs/checkpoint.c
b/fs/f2fs/checkpoint.c
index 35601b0d077f1333f17ec03eee3acc172db72f48..698b13ae261c03833453e4c97a3b18329dece46d 100644
(file)
--- a/
fs/f2fs/checkpoint.c
+++ b/
fs/f2fs/checkpoint.c
@@
-770,7
+770,7
@@
int get_valid_checkpoint(struct f2fs_sb_info *sbi)
/* Sanity checking of checkpoint */
if (sanity_check_ckpt(sbi))
- goto fail_no_cp;
+ goto f
ree_f
ail_no_cp;
if (cur_page == cp1)
sbi->cur_cp_pack = 1;
@@
-798,6
+798,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;