Skip to contentSkip to conversation

mt76: mt7915: fix calling mt76_wcid_alloc with incorrect parameter

PATCH New Bo Jiao 1 participant 1 message Jul 6, 2021

Subsystems (2)
lore
Share & tools
lore

Bo Jiao

author
#0 lore raw

PATCH 1/1 mt76: mt7915: fix calling mt76_wcid_alloc with incorrect parameter

From: Bo Jiao <[email protected]>

It will cause maximum connectable STA to be one less when calling mt76_wcid_alloc with parameter MT7915_WTBL_STA - 1.

---
 drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7915/init.c +1 -1
index 4798d6344305..1d2214519f5a 100644
@@ -480,7 +480,7 @@ static int mt7915_init_hardware(struct mt7915_dev *dev)
 	}
 
 	/* Beacon and mgmt frames should occupy wcid 0 */
-	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA - 1);
+	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
 	if (idx)
 		return -ENOSPC;
 
drivers/net/wireless/mediatek/mt76/mt7915/main.c +1 -1
index c25f8da590dd..d8abebcffe4b 100644
@@ -613,7 +613,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
 	struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
 	int ret, idx;
 
-	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA - 1);
+	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
 	if (idx < 0)
 		return -ENOSPC;
 
Signature · 1 line
2.18.0