public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [EDT][PATCH] XHCI: Fix memory leak in error condition
@ 2015-06-26  7:46 Vivek Kumar Bhagat
  2015-06-26  7:52 ` Roger Quadros
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vivek Kumar Bhagat @ 2015-06-26  7:46 UTC (permalink / raw)
  To: linux-usb, gregkh, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 759 bytes --]

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;
-- 
1.7.9.5ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [EDT][PATCH] XHCI: Fix memory leak in error condition
  2015-06-26  7:46 [EDT][PATCH] XHCI: Fix memory leak in error condition Vivek Kumar Bhagat
@ 2015-06-26  7:52 ` Roger Quadros
  2015-06-26 16:43 ` Greg KH
  2015-06-26 16:44 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Roger Quadros @ 2015-06-26  7:52 UTC (permalink / raw)
  To: vivek.bhagat, linux-usb, gregkh, linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [EDT][PATCH] XHCI: Fix memory leak in error condition
  2015-06-26  7:46 [EDT][PATCH] XHCI: Fix memory leak in error condition Vivek Kumar Bhagat
  2015-06-26  7:52 ` Roger Quadros
@ 2015-06-26 16:43 ` Greg KH
  2015-06-26 16:44 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2015-06-26 16:43 UTC (permalink / raw)
  To: Vivek Kumar Bhagat; +Cc: linux-usb, linux-kernel

On Fri, Jun 26, 2015 at 07:46:00AM +0000, Vivek Kumar Bhagat wrote:
> EP-EC562D6B53594479BCA6FC73F17DEE54

What is that crazy line for?  It doesn't belong here.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [EDT][PATCH] XHCI: Fix memory leak in error condition
  2015-06-26  7:46 [EDT][PATCH] XHCI: Fix memory leak in error condition Vivek Kumar Bhagat
  2015-06-26  7:52 ` Roger Quadros
  2015-06-26 16:43 ` Greg KH
@ 2015-06-26 16:44 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2015-06-26 16:44 UTC (permalink / raw)
  To: Vivek Kumar Bhagat; +Cc: linux-usb, linux-kernel

On Fri, Jun 26, 2015 at 07:46:00AM +0000, 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(+)

Also, please use scripts/get_maintainer.pl to determine who to send
patches to.  Hint, I'm not the one for this patch, I can't do anything
with it...

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-26 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-26  7:46 [EDT][PATCH] XHCI: Fix memory leak in error condition Vivek Kumar Bhagat
2015-06-26  7:52 ` Roger Quadros
2015-06-26 16:43 ` Greg KH
2015-06-26 16:44 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox