From patchwork Tue Dec 21 03:59:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 423511 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBL3xQIY023271 for ; Tue, 21 Dec 2010 03:59:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933525Ab0LUD7X (ORCPT ); Mon, 20 Dec 2010 22:59:23 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:36689 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933506Ab0LUD7W (ORCPT ); Mon, 20 Dec 2010 22:59:22 -0500 Received: by wyb28 with SMTP id 28so3541653wyb.19 for ; Mon, 20 Dec 2010 19:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=PNA9gWg5TT+PR/3flOxdl4qQbF81ONpOfwCodB567/A=; b=amUr2LwhnBNkbcd2W3Dw01wBsK1XzRMGnPGyDsOVdqhlvbFfdcMwTth0sJfM44e4jg NjtWg3mmH1tKRNATCK67Fhx+vxYYqHRqisZaMg9CAzhR8SHElrT0xUO/gh5nPX13Rq71 seovl2xd3Wn1A3cRuCB5oImlW2QuFHzwZkHn8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=LNTPlYQnquyuUrcvnABm3EPU+7/tX0KBgpkLZ6A1uGNyWIAZ+OykIaTdRWT973bepe TDULr+c4GaTYQCdwKKeWg3UW9kRjLcmt82zP2Zyu5VjEezF70J2c2/NPRscmtbfWMhwW +Of4WRxcgZYJZPI5wB/T4xtMTWpb5Z7N8dlXo= Received: by 10.216.141.75 with SMTP id f53mr5658618wej.16.1292903960961; Mon, 20 Dec 2010 19:59:20 -0800 (PST) Received: from bicker ([41.202.225.147]) by mx.google.com with ESMTPS id n1sm2248790weq.7.2010.12.20.19.59.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 20 Dec 2010 19:59:18 -0800 (PST) Date: Tue, 21 Dec 2010 06:59:06 +0300 From: Dan Carpenter To: "Luis R. Rodriguez" Cc: Jouni Malinen , Vasanthakumar Thiagarajan , Senthil Balasubramanian , "John W. Linville" , linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net, kernel-janitors@vger.kernel.org Subject: [patch -next] ath9k: unlock on error path in ath9k_change_interface() Message-ID: <20101221035906.GC1936@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 21 Dec 2010 03:59:26 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index cb53fbb..0ffa115 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -1481,6 +1481,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = aphy->sc; struct ath_common *common = ath9k_hw_common(sc->sc_ah); + int ret = 0; ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n"); mutex_lock(&sc->mutex); @@ -1490,7 +1491,8 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, case NL80211_IFTYPE_ADHOC: if (sc->nbcnvifs >= ATH_BCBUF) { ath_err(common, "No beacon slot available\n"); - return -ENOBUFS; + ret = -ENOBUFS; + goto out; } break; case NL80211_IFTYPE_STATION: @@ -1504,14 +1506,15 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, default: ath_err(common, "Interface type %d not yet supported\n", vif->type); - mutex_unlock(&sc->mutex); - return -ENOTSUPP; + ret = -ENOTSUPP; + goto out; } vif->type = new_type; vif->p2p = p2p; +out: mutex_unlock(&sc->mutex); - return 0; + return ret; } static void ath9k_remove_interface(struct ieee80211_hw *hw,