efivarfs: efivarfs_fill_super() ensure we free our temporary name
authorAndy Whitcroft <apw@canonical.com>
Thu, 11 Oct 2012 10:32:20 +0000 (11:32 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Tue, 30 Oct 2012 10:39:23 +0000 (10:39 +0000)
d_alloc_name() copies the passed name to new storage, once complete we
no longer need our name.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
drivers/firmware/efivars.c

index adfc4863202b92a1354753b4eed685047ea88525..36b3dd6e1e5eaafde9aaa3b4ab3d52c1d807a54f 100644 (file)
@@ -992,6 +992,8 @@ int efivarfs_fill_super(struct super_block *sb, void *data, int silent)
                inode = efivarfs_get_inode(efivarfs_sb, root->d_inode,
                                          S_IFREG | 0644, 0);
                dentry = d_alloc_name(root, name);
+               /* copied by the above to local storage in the dentry. */
+               kfree(name);
 
                efivars->ops->get_variable(entry->var.VariableName,
                                           &entry->var.VendorGuid,