exfat: fix memory leak in exfat_fill_super
Subsystems (2)
PATCH 1/1 exfat: fix memory leak in exfat_fill_super
If exFAT encounters errors during multiple mount operations, 'sbi' and 'nls' will not be released, which will cause a memory leak.
Fixes 719c1e1829166 ("exfat: add super block operations")
Signed-off-by YangWen <[email protected]>
--- fs/exfat/super.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/exfat/super.c +5 -0
@@ -722,10 +722,15 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_root =NULL ; free_table: +exfat_free_upcase_table (sbi);exfat_free_bitmap (sbi);brelse (sbi->boot_bh); check_nls_io: +unload_nls (sbi->nls_io); +exfat_free_iocharset (sbi); + sb->s_fs_info =NULL ; +kfree (sbi);return err; }
Signature · 1 line
2.43.0
Namjae Jeon
maintainerQuoted 3 lines · YangWen
If exFAT encounters errors during multiple mount operations, 'sbi' and 'nls' will not be released, which will cause a memory leak.
delayed_free() will free them.
Please check it.
Thanks.
Quoted 3 lines
Fixes 719c1e1829166 ("exfat: add super block operations")Signed-off-by YangWen <[email protected]>