From patchwork Mon Nov 30 08:17:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 63631 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAU8IWvB026355 for ; Mon, 30 Nov 2009 08:18:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753393AbZK3ISW (ORCPT ); Mon, 30 Nov 2009 03:18:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753156AbZK3ISW (ORCPT ); Mon, 30 Nov 2009 03:18:22 -0500 Received: from smtp.nokia.com ([192.100.122.233]:51876 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753346AbZK3ISV (ORCPT ); Mon, 30 Nov 2009 03:18:21 -0500 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nAU8HxkY017554; Mon, 30 Nov 2009 10:18:22 +0200 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Nov 2009 10:17:56 +0200 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Nov 2009 10:17:55 +0200 Received: from [127.0.1.1] (essapo-nirac252146.europe.nokia.com [10.162.252.146]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nAU8HsDP011912; Mon, 30 Nov 2009 10:17:54 +0200 Subject: [PATCH v2 03/11] wl1251: fix error handling in wl1251_op_config() To: linville@tuxdriver.com From: Kalle Valo Cc: linux-wireless@vger.kernel.org Date: Mon, 30 Nov 2009 10:17:52 +0200 Message-ID: <20091130081752.17360.50112.stgit@tikku> In-Reply-To: <20091130081706.17360.48084.stgit@tikku> References: <20091130081706.17360.48084.stgit@tikku> User-Agent: StGit/0.15 MIME-Version: 1.0 X-OriginalArrivalTime: 30 Nov 2009 08:17:55.0368 (UTC) FILETIME=[9E516280:01CA7195] X-Nokia-AV: Clean Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c index 0417745..24050d5 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) * through the bss_info_changed() hook. */ ret = wl1251_ps_set_mode(wl, STATION_POWER_SAVE_MODE); + if (ret < 0) + goto out_sleep; } else if (!(conf->flags & IEEE80211_CONF_PS) && wl->psm_requested) { wl1251_debug(DEBUG_PSM, "psm disabled"); wl->psm_requested = false; - if (wl->psm) + if (wl->psm) { ret = wl1251_ps_set_mode(wl, STATION_ACTIVE_MODE); + if (ret < 0) + goto out_sleep; + } } if (conf->power_level != wl->power_level) { ret = wl1251_acx_tx_power(wl, conf->power_level); if (ret < 0) - goto out; + goto out_sleep; wl->power_level = conf->power_level; }