Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bob Copeland and committed by
John W. Linville
be009370 667ecd01

+9 -1
+9 -1
drivers/net/wireless/ath5k/base.c
··· 1028 1028 * it's done by reseting the chip. To accomplish this we must 1029 1029 * first cleanup any pending DMA, then restart stuff after a la 1030 1030 * ath5k_init. 1031 + * 1032 + * Called with sc->lock. 1031 1033 */ 1032 1034 static int 1033 1035 ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan) ··· 2816 2814 { 2817 2815 struct ath5k_softc *sc = hw->priv; 2818 2816 struct ieee80211_conf *conf = &hw->conf; 2817 + int ret; 2818 + 2819 + mutex_lock(&sc->lock); 2819 2820 2820 2821 sc->bintval = conf->beacon_int; 2821 2822 sc->power_level = conf->power_level; 2822 2823 2823 - return ath5k_chan_set(sc, conf->channel); 2824 + ret = ath5k_chan_set(sc, conf->channel); 2825 + 2826 + mutex_unlock(&sc->lock); 2827 + return ret; 2824 2828 } 2825 2829 2826 2830 static int