[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220105123447.24674-1-asha.16@itfac.mrt.ac.lk>
Date: Wed, 5 Jan 2022 18:04:47 +0530
From: "F.A.Sulaiman" <asha.16@...ac.mrt.ac.lk>
To: gregkh@...uxfoundation.org, fabioaiuto83@...il.com,
marcocesati@...il.com, dan.carpenter@...cle.com,
hdegoede@...hat.com
Cc: "F.A.Sulaiman" <asha.16@...ac.mrt.ac.lk>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH v2] rtl8723bs: fix memory leak error
Smatch reported memory leak bug in rtl8723b_FirmwareDownload function.
The problem is pFirmware memory is not released in 'release_fw1'.
Instead of redirecting to 'release_fw1', we can turn it into 'exit'
and free the memory.
Signed-off-by: F.A. SULAIMAN <asha.16@...ac.mrt.ac.lk>
---
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index f1fc077ed29c..5f09b3ef9459 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -361,7 +361,7 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)
netdev_emerg(padapter->pnetdev,
"Firmware size:%u exceed %u\n",
pFirmware->fw_length, FW_8723B_SIZE);
- goto release_fw1;
+ goto exit;
}
pFirmwareBuf = pFirmware->fw_buffer_sz;
--
2.17.1
Powered by blists - more mailing lists