diff options
author | Julian Calaby <julian.calaby@gmail.com> | 2016-03-17 22:29:11 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-04-07 12:37:50 -0400 |
commit | 84d17a2a5a0f9e19e25d0472f0528996d945826e (patch) | |
tree | 81280c305fe55e46481738fccabd0bba9858bead | |
parent | c2fd34469d1623111e3c3db65cde533f3bddc26e (diff) |
iwl4965: Fix more memory leaks in __il4965_up()
In some of the non-success return paths, the memory allocated by
iwl4965_sta_alloc_lq() in iwl4965_alloc_bcast_station() is not freed.
In particular:
- if the card isn't ready after il4965_prepare_card_hw()
- if the card is hardware-rfkilled
In the hardware rfkilled path, the driver enables the rfkill
interrupt. When the card is unrfkilled and this interrupt is raised
we end up calling il4965_bg_restart() which calls __il4965_up() which
calls iwl4965_alloc_bcast_station() again.
Suggested-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/intel/iwlegacy/4965-mac.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c index 30d9dd3dda53..f9ed48070e17 100644 --- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c | |||
@@ -5553,6 +5553,7 @@ __il4965_up(struct il_priv *il) | |||
5553 | 5553 | ||
5554 | il4965_prepare_card_hw(il); | 5554 | il4965_prepare_card_hw(il); |
5555 | if (!il->hw_ready) { | 5555 | if (!il->hw_ready) { |
5556 | il_dealloc_bcast_stations(il); | ||
5556 | IL_ERR("HW not ready\n"); | 5557 | IL_ERR("HW not ready\n"); |
5557 | return -EIO; | 5558 | return -EIO; |
5558 | } | 5559 | } |
@@ -5564,6 +5565,7 @@ __il4965_up(struct il_priv *il) | |||
5564 | set_bit(S_RFKILL, &il->status); | 5565 | set_bit(S_RFKILL, &il->status); |
5565 | wiphy_rfkill_set_hw_state(il->hw->wiphy, true); | 5566 | wiphy_rfkill_set_hw_state(il->hw->wiphy, true); |
5566 | 5567 | ||
5568 | il_dealloc_bcast_stations(il); | ||
5567 | il_enable_rfkill_int(il); | 5569 | il_enable_rfkill_int(il); |
5568 | IL_WARN("Radio disabled by HW RF Kill switch\n"); | 5570 | IL_WARN("Radio disabled by HW RF Kill switch\n"); |
5569 | return 0; | 5571 | return 0; |