mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 16:21:45 -04:00
staging: r8188eu: release_firmware is not called if allocation fails
In function load_firmware() release_firmware() is not called if the
allocation of pFirmware->szFwBuffer fails or if fw->size is greater
than FW_8188E_SIZE.
Move the call to release_firmware() to the exit label at the end of
the function to fix this.
Fixes: 8cd574e6af ("staging: r8188eu: introduce new hal dir for RTL8188eu driver")
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220107103620.15648-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6da9712503
commit
39850edf2b
@@ -538,10 +538,10 @@ static int load_firmware(struct rt_firmware *pFirmware, struct device *device)
|
||||
}
|
||||
memcpy(pFirmware->szFwBuffer, fw->data, fw->size);
|
||||
pFirmware->ulFwLength = fw->size;
|
||||
release_firmware(fw);
|
||||
dev_dbg(device, "!bUsedWoWLANFw, FmrmwareLen:%d+\n", pFirmware->ulFwLength);
|
||||
|
||||
Exit:
|
||||
release_firmware(fw);
|
||||
return rtStatus;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user