public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: <vivek.bhagat@samsung.com>, <linux-usb@vger.kernel.org>,
	<gregkh@linuxfoundation.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [EDT][PATCH] XHCI: Fix memory leak in error condition
Date: Fri, 26 Jun 2015 10:52:21 +0300	[thread overview]
Message-ID: <558D04B5.40505@ti.com> (raw)
In-Reply-To: <1646270916.306041435304760891.JavaMail.weblogic@ep2mlwas07b>

On 26/06/15 10:46, Vivek Kumar Bhagat wrote:
> EP-EC562D6B53594479BCA6FC73F17DEE54
> In error condition, td buffer is not freed which can lead
> to memory leak.
>
> Signed-off-by: Vivek Kumar Bhagat <vivek.bhagat@samsung.com>
> ---
>   drivers/usb/host/xhci.c |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 36bf089..dc02532 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -1438,6 +1438,7 @@ dying:
>   	ret = -ESHUTDOWN;
>   free_priv:
>   	xhci_urb_free_priv(urb_priv);
> +	kfree(buffer);
>   	urb->hcpriv = NULL;
>   	spin_unlock_irqrestore(&xhci->lock, flags);
>   	return ret;
>

Do you need to fix up xhci_urb_free_priv() as well?

cheers,
-roger

  reply	other threads:[~2015-06-26  7:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26  7:46 [EDT][PATCH] XHCI: Fix memory leak in error condition Vivek Kumar Bhagat
2015-06-26  7:52 ` Roger Quadros [this message]
2015-06-26 16:43 ` Greg KH
2015-06-26 16:44 ` Greg KH

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=558D04B5.40505@ti.com \
    --to=rogerq@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=vivek.bhagat@samsung.com \
    /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