diff mbox series

[2/3] efivarfs: Free s_fs_info on unmount

Message ID 20231208163925.3225018-7-ardb@google.com
State New
Headers show
Series efivarfs fixes | expand

Commit Message

Ard Biesheuvel Dec. 8, 2023, 4:39 p.m. UTC
From: Ard Biesheuvel <ardb@kernel.org>

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 | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index 72013125d7fa..891acf7b0903 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -356,10 +356,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 = {