All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: Fix memory leak in firmware loading
@ 2015-01-02 18:17 Larry Finger
  2015-01-03  5:57 ` Larry Finger
  0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2015-01-02 18:17 UTC (permalink / raw)
  To: gregkh; +Cc: devel, netdev, Larry Finger

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 <Larry.Finger@lwfinger.net>
---
 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;
 }
-- 
2.1.2

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

* Re: [PATCH] staging: r8188eu: Fix memory leak in firmware loading
  2015-01-02 18:17 [PATCH] staging: r8188eu: Fix memory leak in firmware loading Larry Finger
@ 2015-01-03  5:57 ` Larry Finger
  0 siblings, 0 replies; 2+ messages in thread
From: Larry Finger @ 2015-01-03  5:57 UTC (permalink / raw)
  To: gregkh; +Cc: devel, netdev

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 <Larry.Finger@lwfinger.net>
> ---
>   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

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

end of thread, other threads:[~2015-01-03  5:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-02 18:17 [PATCH] staging: r8188eu: Fix memory leak in firmware loading Larry Finger
2015-01-03  5:57 ` Larry Finger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.