aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@nokia.com>2009-11-30 03:17:52 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-21 18:55:49 -0500
commit478fdf2bcef73747eb99bc6dd3565f093942647a (patch)
treeb4a26445c5131adf591c5976ebb16bce01d6b5b1 /drivers/net
parentd67e261829d405ed19a6c2e648f224e352012f52 (diff)
wl1251: fix error handling in wl1251_op_config()
Not all return values were checked and one exit from function didn't put firmware sleep after the error. Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index 0417745d7fc4..24050d56a9de 100644
--- a/drivers/net/wireless/wl12xx/wl1251_main.c
+++ b/drivers/net/wireless/wl12xx/wl1251_main.c
@@ -645,20 +645,25 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
645 * through the bss_info_changed() hook. 645 * through the bss_info_changed() hook.
646 */ 646 */
647 ret = wl1251_ps_set_mode(wl, STATION_POWER_SAVE_MODE); 647 ret = wl1251_ps_set_mode(wl, STATION_POWER_SAVE_MODE);
648 if (ret < 0)
649 goto out_sleep;
648 } else if (!(conf->flags & IEEE80211_CONF_PS) && 650 } else if (!(conf->flags & IEEE80211_CONF_PS) &&
649 wl->psm_requested) { 651 wl->psm_requested) {
650 wl1251_debug(DEBUG_PSM, "psm disabled"); 652 wl1251_debug(DEBUG_PSM, "psm disabled");
651 653
652 wl->psm_requested = false; 654 wl->psm_requested = false;
653 655
654 if (wl->psm) 656 if (wl->psm) {
655 ret = wl1251_ps_set_mode(wl, STATION_ACTIVE_MODE); 657 ret = wl1251_ps_set_mode(wl, STATION_ACTIVE_MODE);
658 if (ret < 0)
659 goto out_sleep;
660 }
656 } 661 }
657 662
658 if (conf->power_level != wl->power_level) { 663 if (conf->power_level != wl->power_level) {
659 ret = wl1251_acx_tx_power(wl, conf->power_level); 664 ret = wl1251_acx_tx_power(wl, conf->power_level);
660 if (ret < 0) 665 if (ret < 0)
661 goto out; 666 goto out_sleep;
662 667
663 wl->power_level = conf->power_level; 668 wl->power_level = conf->power_level;
664 } 669 }