rtl8192{ce,cu,de,se}: avoid problems because of possible ERFOFF -> ERFSLEEP transition
authorPhilipp Dreimann <philipp@dreimann.net>
Wed, 7 Dec 2011 19:43:31 +0000 (13:43 -0600)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Dec 2011 20:09:54 +0000 (15:09 -0500)
In drivers rtl8192ce, rtl8192cu, rtl8192se, and rtl8192de, break
statements would allow ppsc->rfpwr_state to be changed to ERFSLEEP
even though the device is actually in ERFOFF.

Signed-off-by: Philipp Dreimann <philipp@dreimann.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Cc: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
drivers/net/wireless/rtlwifi/rtl8192de/phy.c
drivers/net/wireless/rtlwifi/rtl8192se/phy.c

index 592a10a..3b585aa 100644 (file)
@@ -569,7 +569,7 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
                }
        case ERFSLEEP:{
                        if (ppsc->rfpwr_state == ERFOFF)
-                               break;
+                               return false;
                        for (queue_id = 0, i = 0;
                             queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
                                ring = &pcipriv->dev.tx_ring[queue_id];
index 7285290..e49cf22 100644 (file)
@@ -548,7 +548,7 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
                break;
        case ERFSLEEP:
                if (ppsc->rfpwr_state == ERFOFF)
-                       break;
+                       return false;
                for (queue_id = 0, i = 0;
                     queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
                        ring = &pcipriv->dev.tx_ring[queue_id];
index 3ac7af1..0883349 100644 (file)
@@ -3374,7 +3374,7 @@ bool rtl92d_phy_set_rf_power_state(struct ieee80211_hw *hw,
                break;
        case ERFSLEEP:
                if (ppsc->rfpwr_state == ERFOFF)
-                       break;
+                       return false;
 
                for (queue_id = 0, i = 0;
                     queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
index f27171a..f10ac1a 100644 (file)
@@ -602,7 +602,7 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
                }
        case ERFSLEEP:
                        if (ppsc->rfpwr_state == ERFOFF)
-                               break;
+                               return false;
 
                        for (queue_id = 0, i = 0;
                             queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {