diff options
author | Bob Copeland <me@bobcopeland.com> | 2009-01-22 08:44:16 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:11:19 -0500 |
commit | be0093705c3ce98d73cac0ca8f93ea105cdf4e9c (patch) | |
tree | 9ca73153044cf3e3ed9e8a8f53d8057e359b748b /drivers/net/wireless | |
parent | 667ecd010d870f861a9e276aaaca8cb443ded8b3 (diff) | |
download | op-kernel-dev-be0093705c3ce98d73cac0ca8f93ea105cdf4e9c.zip op-kernel-dev-be0093705c3ce98d73cac0ca8f93ea105cdf4e9c.tar.gz |
ath5k: fix locking in ath5k_config
ath5k_config updates the software context without taking sc->lock.
Changes-licensed-under: 3-Clause-BSD
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 8ef8735..a533ed6 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c @@ -1028,6 +1028,8 @@ ath5k_setup_bands(struct ieee80211_hw *hw) * it's done by reseting the chip. To accomplish this we must * first cleanup any pending DMA, then restart stuff after a la * ath5k_init. + * + * Called with sc->lock. */ static int ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan) @@ -2814,11 +2816,17 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed) { struct ath5k_softc *sc = hw->priv; struct ieee80211_conf *conf = &hw->conf; + int ret; + + mutex_lock(&sc->lock); sc->bintval = conf->beacon_int; sc->power_level = conf->power_level; - return ath5k_chan_set(sc, conf->channel); + ret = ath5k_chan_set(sc, conf->channel); + + mutex_unlock(&sc->lock); + return ret; } static int |