Skip to contentSkip to conversation

wifi: iwlegacy: fix broadcast stations deallocation

PATCH New [email protected] 1 participant 1 message Aug 20 Intel wireless 3945ABG/bg, 4965AGN (iwlegacy)

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 wifi: iwlegacy: fix broadcast stations deallocation

From: Stanislaw Gruszka <[email protected]>

On the error path of __il4965_up(), il_dealloc_bcast_stations() clears only IL_STA_UCODE_ACTIVE, leaving IL_STA_BCAST set. This causes the same broadcast stations to be deallocated again by __il4965_down().

This can occur when RF_KILL is toggled during driver startup.

To fix clear the entire 'used' field, since we will not do any other operations on the station.

Fixes c2fd34469d16 ("iwl4965: Fix a memory leak in error handling code of __il4965_up")
Cc <[email protected]> # 7.1.x: 57aa1718d595 wifi: iwlegacy: replace BUG_ON() with WARN_ON() on num_stations check
Cc <[email protected]> # 6.x.x: 57aa1718d595 wifi: iwlegacy: replace BUG_ON() with WARN_ON() on num_stations check
Cc <[email protected]> # 5.x.x: 57aa1718d595 wifi: iwlegacy: replace BUG_ON() with WARN_ON() on num_stations check
---
 drivers/net/wireless/intel/iwlegacy/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlegacy/common.c +1 -1
index 0bb807ff8edf..e5113c6b2d5c 100644
@@ -2326,7 +2326,7 @@ il_dealloc_bcast_stations(struct il_priv *il)
 		if (!(il->stations[i].used & IL_STA_BCAST))
 			continue;
 
-		il->stations[i].used &= ~IL_STA_UCODE_ACTIVE;
+		il->stations[i].used = 0;
 		il->num_stations--;
 		if (WARN_ON(il->num_stations < 0))
 			il->num_stations = 0;
Signature · 1 line
2.50.1