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/ath5k | |
parent | 667ecd010d870f861a9e276aaaca8cb443ded8b3 (diff) |
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/ath5k')
-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 8ef87356e083..a533ed60bb4d 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) | |||
1028 | * it's done by reseting the chip. To accomplish this we must | 1028 | * it's done by reseting the chip. To accomplish this we must |
1029 | * first cleanup any pending DMA, then restart stuff after a la | 1029 | * first cleanup any pending DMA, then restart stuff after a la |
1030 | * ath5k_init. | 1030 | * ath5k_init. |
1031 | * | ||
1032 | * Called with sc->lock. | ||
1031 | */ | 1033 | */ |
1032 | static int | 1034 | static int |
1033 | ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan) | 1035 | ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan) |
@@ -2814,11 +2816,17 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed) | |||
2814 | { | 2816 | { |
2815 | struct ath5k_softc *sc = hw->priv; | 2817 | struct ath5k_softc *sc = hw->priv; |
2816 | struct ieee80211_conf *conf = &hw->conf; | 2818 | struct ieee80211_conf *conf = &hw->conf; |
2819 | int ret; | ||
2820 | |||
2821 | mutex_lock(&sc->lock); | ||
2817 | 2822 | ||
2818 | sc->bintval = conf->beacon_int; | 2823 | sc->bintval = conf->beacon_int; |
2819 | sc->power_level = conf->power_level; | 2824 | sc->power_level = conf->power_level; |
2820 | 2825 | ||
2821 | return ath5k_chan_set(sc, conf->channel); | 2826 | ret = ath5k_chan_set(sc, conf->channel); |
2827 | |||
2828 | mutex_unlock(&sc->lock); | ||
2829 | return ret; | ||
2822 | } | 2830 | } |
2823 | 2831 | ||
2824 | static int | 2832 | static int |