Unverified Commit bca07979 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5674 mac80211: fix locking in ieee80211_start_ap error path

parents 9022a417 fda018f2
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -972,10 +972,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
					IEEE80211_P2P_OPPPS_ENABLE_BIT;

	err = ieee80211_assign_beacon(sdata, &params->beacon, NULL);
	if (err < 0) {
		ieee80211_vif_release_channel(sdata);
		return err;
	}
	if (err < 0)
		goto error;
	changed |= err;

	err = drv_start_ap(sdata->local, sdata);
@@ -985,8 +983,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;
		goto error;
	}

	ieee80211_recalc_dtim(local, sdata);
@@ -997,6 +994,13 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
		netif_carrier_on(vlan->dev);

	return 0;

error:
	mutex_lock(&local->mtx);
	ieee80211_vif_release_channel(sdata);
	mutex_unlock(&local->mtx);

	return err;
}

static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,