staging: rtl8192e: fix memory leak
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Tue, 15 Sep 2015 11:52:28 +0000 (17:22 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Sep 2015 13:47:05 +0000 (06:47 -0700)
If the size of the firmware is not as expected then we are jumping to the
error path but we missed releasing the firmware.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c

index 5c527c419bc9eeb474ebd01f82ed526324594c7c..3c1b86cce8d680eebca5fac7bb280256c4a0c48a 100644 (file)
@@ -273,6 +273,7 @@ bool rtl92e_init_fw(struct net_device *dev)
                                    sizeof(pfirmware->firmware_buf[i])) {
                                        RT_TRACE(COMP_FIRMWARE,
                                                 "img file size exceed the container struct buffer fail!\n");
+                                       release_firmware(fw_entry);
                                        goto download_firmware_fail;
                                }