ath9k: Fix build error in ath_reset_internal
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>
Fri, 20 Jun 2014 17:17:49 +0000 (22:47 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 20 Jun 2014 18:13:46 +0000 (14:13 -0400)
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 <nbd@openwrt.org>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c

index cf21652835c182b72fcb6d88558493fc2cc0caca..83cb39efb636935647d3c9002e82ba17c19be444 100644 (file)
@@ -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);