staging: r8188eu: release_firmware is not called if allocation fails
authorMichael Straube <straube.linux@gmail.com>
Fri, 7 Jan 2022 10:36:04 +0000 (11:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jan 2022 15:13:36 +0000 (16:13 +0100)
commit39850edf2befe27bcb3d6c37b6ee76d2ee4df903
treea6635b375c889af9c0b61a0d15be9717110a51e3
parent6da97125036fe9b50182f1825a84b5ac057d02cf
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: 8cd574e6af54 ("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>
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c