lkml.org 
[lkml]   [2011]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] Free fw_priv in fw_create_instance
On Wed, Aug 31, 2011 at 12:36:32AM +0530, Rajan Aggarwal wrote:
> fw_priv is not being freed in some of the error scenarios in
> fw_create_instance.

Not true.

> This patch makes sure that this is kfreed properly in all error
> situations in the fw_create_instance logic where it is required.

Nope, this will cause a double-free to happen.

> Signed-off-by: Rajan Aggarwal <rajan.aggarwal85@gmail.com>
> ---
> drivers/base/firmware_class.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
> index 06ed6b4..3ddbc48 100644
> --- a/drivers/base/firmware_class.c
> +++ b/drivers/base/firmware_class.c
> @@ -497,6 +497,7 @@ err_del_dev:
> device_del(f_dev);
> err_put_dev:
> put_device(f_dev);
> + kfree(fw_priv);

Did you test this patch out? What happened when you tested it?

How did you find this "problem"?

Care to look a bit closer at the code?

I'd give you a hint, but it's more sporting this way :)

thanks,

greg k-h


\
 
 \ /
  Last update: 2011-08-30 21:23    [W:0.040 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site