mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pratyush Anand <pratyush.anand@st.com>
To: Axel Lin <axel.lin@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] drivers/misc: fix a memory leak in spear_pcie_gadget_probe error path
Date: Wed, 25 May 2011 08:59:41 +0530	[thread overview]
Message-ID: <4DDC77A5.6020607@st.com> (raw)
In-Reply-To: <1306293835.3358.1.camel@phoenix>

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@gmail.com>
> ---
>  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:


      reply	other threads:[~2011-05-25  3:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25  3:23 Axel Lin
2011-05-25  3:29 ` Pratyush Anand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DDC77A5.6020607@st.com \
    --to=pratyush.anand@st.com \
    --cc=akpm@linux-foundation.org \
    --cc=axel.lin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome