efivarfs: Free s_fs_info on unmount
authorArd Biesheuvel <ardb@kernel.org>
Fri, 8 Dec 2023 16:39:28 +0000 (17:39 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Mon, 11 Dec 2023 10:19:17 +0000 (11:19 +0100)
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 <ardb@kernel.org>
fs/efivarfs/super.c

index d4530e4eac06ae714636957b2cd4139caec16726..f954b1fab91597c3c2514bf1188f4255636d5ca1 100644 (file)
@@ -368,10 +368,13 @@ 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);
 
        /* Remove all entries and destroy */
        efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL);
+       kfree(sfi);
 }
 
 static struct file_system_type efivarfs_type = {