Re: [PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-12 Thread Khalid Aziz
On Fri, 2012-10-12 at 20:21 +0100, Matt Fleming wrote: > This is a common idiom used throughout the kernel to simply error paths. > As you noted, calling kfree(NULL) is harmless and there's certainly no > need to worry about the overhead of calling kfree() without doing any > freeing since the

Re: [PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-12 Thread Matt Fleming
On Fri, 2012-10-12 at 13:03 -0600, Khalid Aziz wrote: > This does not read right. If kzalloc() fails, var will be a NULL > pointer. This code will set err to -ENOMEM and jump to out: where since > err is non-zero, this code will call kfree(Var) but var is a NULL > pointer at this point. Now

Re: [PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-12 Thread Khalid Aziz
On Thu, 2012-10-11 at 11:32 +0100, Andy Whitcroft wrote: > Signed-off-by: Andy Whitcroft > --- > drivers/firmware/efivars.c | 14 +- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c > index ae50d2f..0bbf742

Re: [PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-12 Thread Khalid Aziz
On Thu, 2012-10-11 at 11:32 +0100, Andy Whitcroft wrote: Signed-off-by: Andy Whitcroft a...@canonical.com --- drivers/firmware/efivars.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index

Re: [PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-12 Thread Matt Fleming
On Fri, 2012-10-12 at 13:03 -0600, Khalid Aziz wrote: This does not read right. If kzalloc() fails, var will be a NULL pointer. This code will set err to -ENOMEM and jump to out: where since err is non-zero, this code will call kfree(Var) but var is a NULL pointer at this point. Now kfree()

Re: [PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-12 Thread Khalid Aziz
On Fri, 2012-10-12 at 20:21 +0100, Matt Fleming wrote: This is a common idiom used throughout the kernel to simply error paths. As you noted, calling kfree(NULL) is harmless and there's certainly no need to worry about the overhead of calling kfree() without doing any freeing since the error

Re: [PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-11 Thread Jeremy Kerr
Hi Andy, Looks good. Thanks for taking the time to review the efivarfs changes. Acked-by: Jeremy Kerr Cheers, Jeremy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-11 Thread Andy Whitcroft
Signed-off-by: Andy Whitcroft --- drivers/firmware/efivars.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index ae50d2f..0bbf742 100644 --- a/drivers/firmware/efivars.c +++

[PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-11 Thread Andy Whitcroft
Signed-off-by: Andy Whitcroft a...@canonical.com --- drivers/firmware/efivars.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index ae50d2f..0bbf742 100644 --- a/drivers/firmware/efivars.c +++

Re: [PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-11 Thread Jeremy Kerr
Hi Andy, Looks good. Thanks for taking the time to review the efivarfs changes. Acked-by: Jeremy Kerr jeremy.k...@canonical.com Cheers, Jeremy -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at