mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-19 16:17:40 +00:00
mac80211: release the channel in error path in start_ap
When the driver cannot start the AP or when the assignement of the beacon goes wrong, we need to unassign the vif. Cc: stable@vger.kernel.org Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
f9d15d162b
commit
0297ea17bf
@ -1021,8 +1021,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
|
||||
IEEE80211_P2P_OPPPS_ENABLE_BIT;
|
||||
|
||||
err = ieee80211_assign_beacon(sdata, ¶ms->beacon);
|
||||
if (err < 0)
|
||||
if (err < 0) {
|
||||
ieee80211_vif_release_channel(sdata);
|
||||
return err;
|
||||
}
|
||||
changed |= err;
|
||||
|
||||
err = drv_start_ap(sdata->local, sdata);
|
||||
@ -1032,6 +1034,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
|
||||
if (old)
|
||||
kfree_rcu(old, rcu_head);
|
||||
RCU_INIT_POINTER(sdata->u.ap.beacon, NULL);
|
||||
ieee80211_vif_release_channel(sdata);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user