From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752090AbbFZHwg (ORCPT ); Fri, 26 Jun 2015 03:52:36 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:50752 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751655AbbFZHw2 (ORCPT ); Fri, 26 Jun 2015 03:52:28 -0400 Message-ID: <558D04B5.40505@ti.com> Date: Fri, 26 Jun 2015 10:52:21 +0300 From: Roger Quadros User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: , , , Subject: Re: [EDT][PATCH] XHCI: Fix memory leak in error condition References: <1646270916.306041435304760891.JavaMail.weblogic@ep2mlwas07b> In-Reply-To: <1646270916.306041435304760891.JavaMail.weblogic@ep2mlwas07b> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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