Skip to content

Commit 4d2150f

Browse files
tititiou36nbd168
authored andcommitted
wifi: mt76: mt7915: Fix an error handling path in mt7915_add_interface()
If mt76_wcid_alloc() fails, the "mt76.mutex" mutex needs to be released as done in the other error handling paths of mt7915_add_interface(). Fixes: f3049b8 ("wifi: mt76: mt7915: allocate vif wcid in the same range as stations") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://patch.msgid.link/b9d8fbfc19360bfe60b9cea1cb0f735ab3b4bc26.1727639596.git.christophe.jaillet@wanadoo.fr Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 9581cd2 commit 4d2150f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • drivers/net/wireless/mediatek/mt76/mt7915

drivers/net/wireless/mediatek/mt76/mt7915/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,10 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
246246
phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx);
247247

248248
idx = mt76_wcid_alloc(dev->mt76.wcid_mask, mt7915_wtbl_size(dev));
249-
if (idx < 0)
250-
return -ENOSPC;
249+
if (idx < 0) {
250+
ret = -ENOSPC;
251+
goto out;
252+
}
251253

252254
INIT_LIST_HEAD(&mvif->sta.rc_list);
253255
INIT_LIST_HEAD(&mvif->sta.wcid.poll_list);

0 commit comments

Comments
 (0)