Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1234340

Re: [PATCH v2] staging: rtl8723au: Fix resource leak

From Jes Sorensen <Jes.Sorensen@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] staging: rtl8723au: Fix resource leak
Date 2015-09-28 20:30 +0200
Message-ID <qdLlw-7nn-15@gated-at.bofh.it> (permalink)
References <qdq7o-8oh-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Mateusz Kulikowski <mateusz.kulikowski@gmail.com> writes:
> Firmware was not released properly if kmemdup fails.
>
> Addresses-Coverity-Id: 1269118
> Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
> ---
>  drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>

>
> diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> index cd014f7..ecf54ee 100644
> --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> @@ -249,13 +249,13 @@ int rtl8723a_FirmwareDownload(struct rtw_adapter *padapter)
>  		goto Exit;
>  	}
>  	firmware_buf = kmemdup(fw->data, fw->size, GFP_KERNEL);
> +	fw_size = fw->size;
> +	release_firmware(fw);
>  	if (!firmware_buf) {
>  		rtStatus = _FAIL;
>  		goto Exit;
>  	}
>  	buf = firmware_buf;
> -	fw_size = fw->size;
> -	release_firmware(fw);
>  
>  	/*  To Check Fw header. Added by tynli. 2009.12.04. */
>  	pFwHdr = (struct rt_8723a_firmware_hdr *)firmware_buf;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2] staging: rtl8723au: Fix resource leak Mateusz Kulikowski <mateusz.kulikowski@gmail.com> - 2015-09-27 21:50 +0200
  Re: [PATCH v2] staging: rtl8723au: Fix resource leak Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-28 13:30 +0200
  Re: [PATCH v2] staging: rtl8723au: Fix resource leak Jes Sorensen <Jes.Sorensen@redhat.com> - 2015-09-28 20:30 +0200

csiph-web