From: Hyeongseok Kim Date: Thu, 12 Nov 2020 09:14:54 +0000 (+0900) Subject: f2fs: fix double free of unicode map X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=89ff6005039a878afac87889fee748fa3f957c3a;p=linux.git f2fs: fix double free of unicode map In case of retrying fill_super with skip_recovery, s_encoding for casefold would not be loaded again even though it's already been freed because it's not NULL. Set NULL after free to prevent double freeing when unmount. Fixes: eca4873ee1b6 ("f2fs: Use generic casefolding support") Signed-off-by: Hyeongseok Kim Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 00eff2f518079..fef22e476c526 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -3918,6 +3918,7 @@ free_bio_info: #ifdef CONFIG_UNICODE utf8_unload(sb->s_encoding); + sb->s_encoding = NULL; #endif free_options: #ifdef CONFIG_QUOTA