Skip to content

Commit

Permalink
mac80211: release the channel in error path in start_ap
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Emmanuel Grumbach authored and Johannes Berg committed Feb 6, 2014
1 parent f9d15d1 commit 0297ea1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &params->beacon);
if (err < 0)
if (err < 0) {
ieee80211_vif_release_channel(sdata);
return err;
}
changed |= err;

err = drv_start_ap(sdata->local, sdata);
Expand All @@ -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;
}

Expand Down

0 comments on commit 0297ea1

Please sign in to comment.