efivarfs: Drop redundant cleanup on fill_super() failure
authorArd Biesheuvel <ardb@kernel.org>
Sat, 24 Feb 2024 17:45:41 +0000 (18:45 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 25 Feb 2024 08:43:38 +0000 (09:43 +0100)
Al points out that kill_sb() will be called if efivarfs_fill_super()
fails and so there is no point in cleaning up the efivar entry list.

Reported-by: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
fs/efivarfs/super.c

index 6038dd39367abe41430c55b04448ced7727dd287..210daac79748fe06a4d930157835c5fb75d675f1 100644 (file)
@@ -343,12 +343,7 @@ static int efivarfs_fill_super(struct super_block *sb, struct fs_context *fc)
        if (err)
                return err;
 
-       err = efivar_init(efivarfs_callback, (void *)sb, true,
-                         &sfi->efivarfs_list);
-       if (err)
-               efivar_entry_iter(efivarfs_destroy, &sfi->efivarfs_list, NULL);
-
-       return err;
+       return efivar_init(efivarfs_callback, sb, true, &sfi->efivarfs_list);
 }
 
 static int efivarfs_get_tree(struct fs_context *fc)