Patch "staging: r8188eu: release_firmware is not called if allocation fails" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    staging: r8188eu: release_firmware is not called if allocation fails

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     staging-r8188eu-release_firmware-is-not-called-if-al.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 7eedd772c735c7ef20ee415e7d02cdb09421ff7e
Author: Michael Straube <straube.linux@xxxxxxxxx>
Date:   Fri Jan 7 11:36:04 2022 +0100

    staging: r8188eu: release_firmware is not called if allocation fails
    
    [ Upstream commit 39850edf2befe27bcb3d6c37b6ee76d2ee4df903 ]
    
    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@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220107103620.15648-4-straube.linux@xxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index a677b2049ef3..9f2b86f9b660 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -572,10 +572,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;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux