From: Rajkumar Manoharan Date: Fri, 20 Jun 2014 17:17:49 +0000 (+0530) Subject: ath9k: Fix build error in ath_reset_internal X-Git-Tag: firefly_0821_release~176^2~3474^2~12^2~179^2~56 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d6067f0e17eb1de7d9b1d792f67d17c6e894b770;p=firefly-linux-kernel-4.4.55.git ath9k: Fix build error in ath_reset_internal drivers/net/wireless/ath/ath9k/main.c:299 ath_reset_internal() error: we previously assumed 'hchan' could be null (see line 293) Cc: Felix Fietkau Reported-by: Dan Carpenter Signed-off-by: Rajkumar Manoharan Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index cf21652835c1..83cb39efb636 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -314,11 +314,9 @@ int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan) if (!ath_prepare_reset(sc)) fastcc = false; - if (hchan) { - spin_lock_bh(&sc->chan_lock); - sc->cur_chandef = sc->cur_chan->chandef; - spin_unlock_bh(&sc->chan_lock); - } + spin_lock_bh(&sc->chan_lock); + sc->cur_chandef = sc->cur_chan->chandef; + spin_unlock_bh(&sc->chan_lock); ath_dbg(common, CONFIG, "Reset to %u MHz, HT40: %d fastcc: %d\n", hchan->channel, IS_CHAN_HT40(hchan), fastcc);