diff mbox

rtlwifi: rtl8723ae: Fix leak in _rtl8723e_read_adapter_info()

Message ID 1470772452-24642-1-git-send-email-cengelma@gmx.at (mailing list archive)
State Accepted
Commit 3eeacaa902a31bdf06bc53f23087dcb1c5f260d6
Delegated to: Kalle Valo
Headers show

Commit Message

Christian Engelmayer Aug. 9, 2016, 7:54 p.m. UTC
In case of (rtlhal->oem_id != RT_CID_DEFAULT), the function directly
returns and leaks the already allocated hwinfo memory. Go through the
correct exit path.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Larry Finger Aug. 10, 2016, 2:11 p.m. UTC | #1
On 08/09/2016 02:54 PM, Christian Engelmayer wrote:
> In case of (rtlhal->oem_id != RT_CID_DEFAULT), the function directly
> returns and leaks the already allocated hwinfo memory. Go through the
> correct exit path.
>
> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
> ---
>  drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
This patch looks good. Thanks.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>


> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
> index b88c7ee72dbf..ba30efc2d195 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
> @@ -1654,7 +1654,7 @@ static void _rtl8723e_read_adapter_info(struct ieee80211_hw *hw,
>  			rtlefuse->autoload_failflag, hwinfo);
>
>  	if (rtlhal->oem_id != RT_CID_DEFAULT)
> -		return;
> +		goto exit;
>
>  	switch (rtlefuse->eeprom_oemid) {
>  	case EEPROM_CID_DEFAULT:
>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kalle Valo Sept. 3, 2016, 4:54 p.m. UTC | #2
Christian Engelmayer <cengelma@gmx.at> wrote:
> In case of (rtlhal->oem_id != RT_CID_DEFAULT), the function directly
> returns and leaks the already allocated hwinfo memory. Go through the
> correct exit path.
> 
> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks, 1 patch applied to wireless-drivers-next.git:

3eeacaa902a3 rtlwifi: rtl8723ae: Fix leak in _rtl8723e_read_adapter_info()
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index b88c7ee72dbf..ba30efc2d195 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -1654,7 +1654,7 @@  static void _rtl8723e_read_adapter_info(struct ieee80211_hw *hw,
 			rtlefuse->autoload_failflag, hwinfo);
 
 	if (rtlhal->oem_id != RT_CID_DEFAULT)
-		return;
+		goto exit;
 
 	switch (rtlefuse->eeprom_oemid) {
 	case EEPROM_CID_DEFAULT: