ath9k: fix double calls to ath_radio_enable
authorFelix Fietkau <nbd@openwrt.org>
Tue, 6 Apr 2010 19:05:01 +0000 (12:05 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 6 Apr 2010 19:53:33 +0000 (15:53 -0400)
With the enable_radio being uninitialized, ath_radio_enable() might be
called twice, which can leave some hardware in an undefined state.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c

index 67ca4e5a60177c848d8c9b73ed472a5094789f62..115e1aeedb592128c615026ed8bc677276fbd91e 100644 (file)
@@ -1532,8 +1532,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
                all_wiphys_idle =  ath9k_all_wiphys_idle(sc);
                ath9k_set_wiphy_idle(aphy, idle);
 
-               if (!idle && all_wiphys_idle)
-                       enable_radio = true;
+               enable_radio = (!idle && all_wiphys_idle);
 
                /*
                 * After we unlock here its possible another wiphy