[PATCH] staging: rtl8192e: fix memory leak

From: Sudip Mukherjee
Date: Tue Sep 15 2015 - 07:52:41 EST


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@xxxxxxxxxxxxxxx>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index 5c527c4..3c1b86c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -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;
}

--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/