From 2554935b08f87e0ce1852635720d2d3ac91fc512 Mon Sep 17 00:00:00 2001 From: Sujith Date: Tue, 3 Mar 2009 10:16:57 +0530 Subject: [PATCH] ath9k: Lock config_interface() callback with a mutex Signed-off-by: Sujith Signed-off-by: John W. Linville --- drivers/net/wireless/ath9k/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index a25dcf949f36..d5b0035e9b9e 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c @@ -2318,6 +2318,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, u32 rfilt = 0; int error, i; + mutex_lock(&sc->mutex); + /* TODO: Need to decide which hw opmode to use for multi-interface * cases */ if (vif->type == NL80211_IFTYPE_AP && @@ -2373,8 +2375,10 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); error = ath_beacon_alloc(sc, 0); - if (error != 0) + if (error != 0) { + mutex_unlock(&sc->mutex); return error; + } ath_beacon_config(sc, 0); } @@ -2393,6 +2397,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, if (vif->type == NL80211_IFTYPE_ADHOC) ath_update_chainmask(sc, 0); + mutex_unlock(&sc->mutex); + return 0; } -- 2.39.5