efivarfs: Free s_fs_info on unmount

[ Upstream commit 547713d502 ]

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: 5329aa5101 ("efivarfs: Add uid/gid mount options")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Ard Biesheuvel 2023-12-08 17:39:28 +01:00 committed by Greg Kroah-Hartman
parent d4a714873d
commit 92be3095c6

View File

@ -368,6 +368,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())
@ -375,6 +377,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 = {