Merge "f2fs: Fix double free issue for s_encoding"

This commit is contained in:
qctecmdr 2020-10-30 01:02:18 -07:00 • committed by Gerrit - the friendly Code Review server
commit 43626c0ab3

View file

@ -1265,7 +1265,10 @@ static void f2fs_put_super(struct super_block *sb)
for (i = 0; i < NR_PAGE_TYPE; i++)
kvfree(sbi->write_io[i]);
#ifdef CONFIG_UNICODE
utf8_unload(sb->s_encoding);
if (sb->s_encoding) {
utf8_unload(sb->s_encoding);
sb->s_encoding = NULL;
}
#endif
kvfree(sbi);
}
@ -3842,7 +3845,10 @@ free_bio_info:
kvfree(sbi->write_io[i]);
#ifdef CONFIG_UNICODE
utf8_unload(sb->s_encoding);
if (sb->s_encoding) {
utf8_unload(sb->s_encoding);
sb->s_encoding = NULL;
}
#endif
free_options:
#ifdef CONFIG_QUOTA