From mboxrd@z Thu Jan 1 00:00:00 1970 From: Larry Finger Subject: Re: [PATCH] staging: r8188eu: Fix memory leak in firmware loading Date: Fri, 02 Jan 2015 23:57:03 -0600 Message-ID: <54A784AF.1050604@lwfinger.net> References: <1420222628-4955-1-git-send-email-Larry.Finger@lwfinger.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Cc: devel@driverdev.osuosl.org, netdev@vger.kernel.org To: gregkh@linuxfoundation.org Return-path: In-Reply-To: <1420222628-4955-1-git-send-email-Larry.Finger@lwfinger.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" List-Id: netdev.vger.kernel.org On 01/02/2015 12:17 PM, Larry Finger wrote: > The driver allocates memory to store the firmware image; however, that > memory is never released. The kmemleak facility was used to find this > error. > > Signed-off-by: Larry Finger > --- > drivers/staging/rtl8188eu/hal/fw.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c > index 3b28754..a5b7fc4 100644 > --- a/drivers/staging/rtl8188eu/hal/fw.c > +++ b/drivers/staging/rtl8188eu/hal/fw.c > @@ -231,6 +231,7 @@ int rtl88eu_download_fw(struct adapter *adapt) > _rtl88e_enable_fw_download(adapt, false); > > err = _rtl88e_fw_free_to_go(adapt); > + kfree(pfwdata); > > return err; > } Greg, Please drop this patch. Unfortunately, further testing showed that the kfree() call is in the wrong place. I will send V2 shortly. Thanks, Larry