diff mbox

iwl4965: Fix a memory leak in error handling code of __il4965_up

Message ID 1452392363-3600-1-git-send-email-baijiaju1990@163.com (mailing list archive)
State Superseded
Delegated to: Kalle Valo
Headers show

Commit Message

Jia-Ju Bai Jan. 10, 2016, 2:19 a.m. UTC
When il4965_hw_nic_init in __il4965_up fails, the memory allocated by 
iwl4965_sta_alloc_lq in iwl4965_alloc_bcast_station is not freed.

This patches adds il_dealloc_bcast_stations in the error handling code of 
__il4965_up to fix this problem.

This patch has been tested in real device, and it actually fixes the bug.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
 drivers/net/wireless/iwlegacy/4965-mac.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Stanislaw Gruszka Jan. 11, 2016, 12:16 p.m. UTC | #1
On Sun, Jan 10, 2016 at 10:19:23AM +0800, Jia-Ju Bai wrote:
> diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
> index 6656215..fd7b5c7 100644
> --- a/drivers/net/wireless/iwlegacy/4965-mac.c
> +++ b/drivers/net/wireless/iwlegacy/4965-mac.c
> @@ -5577,6 +5577,7 @@ __il4965_up(struct il_priv *il)
>  	ret = il4965_hw_nic_init(il);
>  	if (ret) {
>  		IL_ERR("Unable to init nic\n");
> +		il_dealloc_bcast_stations(il);
>  		return ret;
>  	}

Please do not repost patches so frequent and if you repost
the unchanged patch mark it so i.e. [PATCH repost].

Stanislaw
--
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 Jan. 11, 2016, 12:44 p.m. UTC | #2
Stanislaw Gruszka <sgruszka@redhat.com> writes:

> On Sun, Jan 10, 2016 at 10:19:23AM +0800, Jia-Ju Bai wrote:
>> diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
>> index 6656215..fd7b5c7 100644
>> --- a/drivers/net/wireless/iwlegacy/4965-mac.c
>> +++ b/drivers/net/wireless/iwlegacy/4965-mac.c
>> @@ -5577,6 +5577,7 @@ __il4965_up(struct il_priv *il)
>>  	ret = il4965_hw_nic_init(il);
>>  	if (ret) {
>>  		IL_ERR("Unable to init nic\n");
>> +		il_dealloc_bcast_stations(il);
>>  		return ret;
>>  	}
>
> Please do not repost patches so frequent and if you repost
> the unchanged patch mark it so i.e. [PATCH repost].

"repost" just confuses me and creates more work for me. Better to ping
on the original patch and even better is to check patchwork which shows
up-to-date status of wireless patches:

https://patchwork.kernel.org/project/linux-wireless/list/
Jia-Ju Bai Jan. 11, 2016, 1:41 p.m. UTC | #3
On 01/11/2016 08:16 PM, Stanislaw Gruszka wrote:
>
> Please do not repost patches so frequent and if you repost
> the unchanged patch mark it so i.e. [PATCH repost].
>
> Stanislaw

Sorry for my reposting.

Jia-Ju Bai

--
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
diff mbox

Patch

diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 6656215..fd7b5c7 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -5577,6 +5577,7 @@  __il4965_up(struct il_priv *il)
 	ret = il4965_hw_nic_init(il);
 	if (ret) {
 		IL_ERR("Unable to init nic\n");
+		il_dealloc_bcast_stations(il);
 		return ret;
 	}