Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1303525 > unrolled thread

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

Started byJia-Ju Bai <baijiaju1990@163.com>
First post2016-01-07 13:20 +0100
Last post2016-01-11 13:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] iwl4965: Fix a memory leak in error handling code of __il4965_up Jia-Ju Bai <baijiaju1990@163.com> - 2016-01-07 13:20 +0100
    Re: [PATCH] iwl4965: Fix a memory leak in error handling code of  __il4965_up Stanislaw Gruszka <sgruszka@redhat.com> - 2016-01-11 13:20 +0100

#1303525 — [PATCH] iwl4965: Fix a memory leak in error handling code of __il4965_up

FromJia-Ju Bai <baijiaju1990@163.com>
Date2016-01-07 13:20 +0100
Subject[PATCH] iwl4965: Fix a memory leak in error handling code of __il4965_up
Message-ID<qOhHQ-7YB-9@gated-at.bofh.it>
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(+)

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;
 	}
 
-- 
1.7.9.5


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

[toc] | [next] | [standalone]


#1306124 — Re: [PATCH] iwl4965: Fix a memory leak in error handling code of __il4965_up

FromStanislaw Gruszka <sgruszka@redhat.com>
Date2016-01-11 13:20 +0100
SubjectRe: [PATCH] iwl4965: Fix a memory leak in error handling code of __il4965_up
Message-ID<qPJC1-2eG-9@gated-at.bofh.it>
In reply to#1303525
On Thu, Jan 07, 2016 at 08:17:39PM +0800, Jia-Ju Bai wrote:
> 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>

Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web