Re: [PATCH] drivers/misc: fix a memory leak in spear_pcie_gadget_probeerror path

From: Pratyush Anand
Date: Tue May 24 2011 - 23:30:24 EST


On 5/25/2011 8:53 AM, Axel Lin wrote:
> In the case of goto err_kzalloc, we should kfree target.
>

Yes, you are right. Its a mistake.

Regards
Pratyush

> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>
> ---
> drivers/misc/spear13xx_pcie_gadget.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/misc/spear13xx_pcie_gadget.c b/drivers/misc/spear13xx_pcie_gadget.c
> index 7aded90..cfbddbe 100644
> --- a/drivers/misc/spear13xx_pcie_gadget.c
> +++ b/drivers/misc/spear13xx_pcie_gadget.c
> @@ -845,7 +845,7 @@ err_iounmap:
> err_iounmap_app:
> iounmap(config->va_app_base);
> err_kzalloc:
> - kfree(config);
> + kfree(target);
> err_rel_res:
> release_mem_region(res1->start, resource_size(res1));
> err_rel_res0:

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/