wifi: mt76: mt7915: Release wiphy mutex if WCID allocation fails.
Subsystems (2)
PATCH 1/1 wifi: mt76: mt7915: Release wiphy mutex if WCID allocation fails.
This fixes a lockup observed when the alloc failed. The mutex is released in the normal exit path - we miss it if we early return here.
Signed-off-by Rory Little <[email protected]>
--- drivers/net/wireless/mediatek/mt76/mt7915/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7915/main.c +4 -2
@@ -265,8 +265,10 @@ static int mt7915_add_interface(struct ieee80211_hw *hw, phy->omac_mask |=BIT_ULL (mvif->mt76.omac_idx); idx =mt76_wcid_alloc (dev->mt76.wcid_mask,mt7915_wtbl_size (dev)); -if (idx <0 ) -return -ENOSPC ; +if (idx <0 ) { + ret = -ENOSPC ; + goto out; + }INIT_LIST_HEAD (&mvif->sta.rc_list);INIT_LIST_HEAD (&mvif->sta.wcid.poll_list);
Signature · 1 line
2.46.0