From: Ard Biesheuvel Date: Fri, 8 Dec 2023 16:39:28 +0000 (+0100) Subject: efivarfs: Free s_fs_info on unmount X-Git-Tag: v6.6.14~551 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48be1364dd387e375e1274b76af986cb8747be2c;p=platform%2Fkernel%2Flinux-starfive.git efivarfs: Free s_fs_info on unmount [ Upstream commit 547713d502f7b4b8efccd409cff84d731a23853b ] Now that we allocate a s_fs_info struct on fs context creation, we should ensure that we free it again when the superblock goes away. Fixes: 5329aa5101f7 ("efivarfs: Add uid/gid mount options") Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin --- diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index 05c0169..d59d967 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c @@ -299,6 +299,8 @@ static int efivarfs_init_fs_context(struct fs_context *fc) static void efivarfs_kill_sb(struct super_block *sb) { + struct efivarfs_fs_info *sfi = sb->s_fs_info; + kill_litter_super(sb); if (!efivar_is_available()) @@ -306,6 +308,7 @@ static void efivarfs_kill_sb(struct super_block *sb) /* Remove all entries and destroy */ efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL); + kfree(sfi); } static struct file_system_type efivarfs_type = {