mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-13 21:02:35 +00:00
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>
This commit is contained in:
parent
9da4aa48d0
commit
7d76173d40
@ -249,13 +249,13 @@ int rtl8723a_FirmwareDownload(struct rtw_adapter *padapter)
|
|||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
firmware_buf = kmemdup(fw->data, fw->size, GFP_KERNEL);
|
firmware_buf = kmemdup(fw->data, fw->size, GFP_KERNEL);
|
||||||
|
fw_size = fw->size;
|
||||||
|
release_firmware(fw);
|
||||||
if (!firmware_buf) {
|
if (!firmware_buf) {
|
||||||
rtStatus = _FAIL;
|
rtStatus = _FAIL;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
buf = firmware_buf;
|
buf = firmware_buf;
|
||||||
fw_size = fw->size;
|
|
||||||
release_firmware(fw);
|
|
||||||
|
|
||||||
/* To Check Fw header. Added by tynli. 2009.12.04. */
|
/* To Check Fw header. Added by tynli. 2009.12.04. */
|
||||||
pFwHdr = (struct rt_8723a_firmware_hdr *)firmware_buf;
|
pFwHdr = (struct rt_8723a_firmware_hdr *)firmware_buf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user