diff options
author | Mateusz Kulikowski <mateusz.kulikowski@gmail.com> | 2015-09-27 21:48:19 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-29 04:29:02 +0200 |
commit | 7d76173d40bef0516068dbf38195470abf979c8a (patch) | |
tree | 93817d3cffc7352fb9fa8f9a9efaa6c4b57f2e89 /drivers/staging/rtl8723au | |
parent | 9da4aa48d04bbdbae3c959809e14da2bf0c53f61 (diff) |
staging: rtl8723au: Fix resource leak
Firmware was not released properly if kmemdup fails.
Addresses-Coverity-Id: 1269118
Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723au')
-rw-r--r-- | drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index cd014f7e6bc3..ecf54ee47f7c 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; |