Search Linux Wireless

[PATCH 6/7] ath9k: Lock config_interface() callback with a mutex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sujith <Sujith.Manoharan@xxxxxxxxxxx>
---
 drivers/net/wireless/ath9k/main.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index ee72a0c..4f68e30 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -2316,6 +2316,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 &&
@@ -2371,8 +2373,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);
 		}
@@ -2391,6 +2395,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;
 }
 
-- 
1.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux