Commit 3341ba9f authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Kalle Valo
Browse files

mt76x0: fix remove_interface



We wrongly use wcid_mask instead of vif_mask. This creates problems
when the interface is removed more than 8 times, for example with iw:

iw dev <devname> interface add <name> type <type>
iw dev <name> del

This caused 'ifconfig up' to fail with error:

SIOCSIFFLAGS: No space left on device

Fixes: 95e44409 ("mt76x0: main file")
Reported-and-tested-by: default avatarSid Hayn <sidhayn@gmail.com>
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 5b394b2d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -77,9 +77,8 @@ static void mt76x0_remove_interface(struct ieee80211_hw *hw,
{
	struct mt76x0_dev *dev = hw->priv;
	struct mt76_vif *mvif = (struct mt76_vif *) vif->drv_priv;
	unsigned int wcid = mvif->group_wcid.idx;

	dev->wcid_mask[wcid / BITS_PER_LONG] &= ~BIT(wcid % BITS_PER_LONG);
	dev->vif_mask &= ~BIT(mvif->idx);
}

static int mt76x0_config(struct ieee80211_hw *hw, u32 changed)