2016-08-09 19:54:44

by Christian Engelmayer

[permalink] [raw]
Subject: [PATCH] rtlwifi: rtl8723ae: Fix leak in _rtl8723e_read_adapter_info()

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 <[email protected]>
---
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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:
--
2.7.4



2016-08-10 18:01:16

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH] rtlwifi: rtl8723ae: Fix leak in _rtl8723e_read_adapter_info()

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 <[email protected]>
> ---
> 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 <[email protected]>


> 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:
>


2016-09-03 17:01:11

by Kalle Valo

[permalink] [raw]
Subject: Re: rtlwifi: rtl8723ae: Fix leak in _rtl8723e_read_adapter_info()

Christian Engelmayer <[email protected]> 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 <[email protected]>
> Acked-by: Larry Finger <[email protected]>

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

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

--
Sent by pwcli
https://patchwork.kernel.org/patch/9272147/