Skip to content

Commit

Permalink
ath5k: fix locking in ath5k_config
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bob Copeland authored and John W. Linville committed Jan 29, 2009
1 parent 667ecd0 commit be00937
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit be00937

Please sign in to comment.