Re: [PATCH 5/5] efivarfs: efivarfs_fill_super() ensure we clean up correctly on error

2012-10-16 Thread Jeremy Kerr
Hi Andy, If we break out of the loop on the second (and onwards) iteration, won't we still have the other inodes and dentries remaining allocated? As we calling this from the mount_single() wrapper: return mount_single(fs_type, flags, data, efivarfs_fill_super); which does this:

Re: [PATCH 5/5] efivarfs: efivarfs_fill_super() ensure we clean up correctly on error

2012-10-11 Thread Andy Whitcroft
On Thu, Oct 11, 2012 at 10:04:28PM +0800, Jeremy Kerr wrote: > Hi Andy, > > >@@ -969,16 +970,18 @@ > > return -ENOMEM; > > > > list_for_each_entry_safe(entry, n, &efivars->list, list) { > >-struct inode *inode; > > struct dentry *dentry, *root = efivarfs_sb-

Re: [PATCH 5/5] efivarfs: efivarfs_fill_super() ensure we clean up correctly on error

2012-10-11 Thread Jeremy Kerr
Hi Andy, @@ -969,16 +970,18 @@ return -ENOMEM; list_for_each_entry_safe(entry, n, &efivars->list, list) { - struct inode *inode; struct dentry *dentry, *root = efivarfs_sb->s_root; - char *name; unsigned long si

[PATCH 5/5] efivarfs: efivarfs_fill_super() ensure we clean up correctly on error

2012-10-11 Thread Andy Whitcroft
Ensure we free both the name and inode on error when building the individual variables. Signed-off-by: Andy Whitcroft --- drivers/firmware/efivars.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c