From patchwork Tue Mar 15 07:01:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 635181 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 p2F72JmS004073 for ; Tue, 15 Mar 2011 07:02:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754169Ab1COHCQ (ORCPT ); Tue, 15 Mar 2011 03:02:16 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:46383 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753471Ab1COHCP (ORCPT ); Tue, 15 Mar 2011 03:02:15 -0400 Received: by fxm17 with SMTP id 17so265364fxm.19 for ; Tue, 15 Mar 2011 00:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=ZbwNGJdvR3qtTyb9EOvL/J84R43XXp3x1+TIoLSYQTU=; b=xuyYLKoKbY6ula22/ow2qwj2C0DymY6xgdXXc/JGc9j5DTrH8TtxPyR9j9C6H83oKf gDDTtPgeOO3nYLSZiLYUiGSysK9wRcyWE24zhtsefAbVUX8YAW8swOHf+prEzPXk4TIu Cg69U6U6OURoODkPXI234IAdvF9/AsWlLiSi8= 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=mTvhCRD2rlXK8lzz4prOLMYFZb6ufD5IL3NX3aSwfUOmC/Wx+gydlPY54gkL+ksyFb q35BPAUG9g8q5XrC0CFXz04W6Ky+esaovS/PwiWK/8dspeMLqoVP4Az4gzhbjRyr06q3 Zn/SaPibRN8s3jivh7H7q/irwXKTZM6euLFUA= Received: by 10.223.16.87 with SMTP id n23mr4663188faa.95.1300172534268; Tue, 15 Mar 2011 00:02:14 -0700 (PDT) Received: from bicker ([212.49.88.34]) by mx.google.com with ESMTPS id n26sm171110fam.37.2011.03.15.00.02.08 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Mar 2011 00:02:13 -0700 (PDT) Date: Tue, 15 Mar 2011 10:01:58 +0300 From: Dan Carpenter To: Wey-Yi Guy , johannes.berg@intel.com Cc: Intel Linux Wireless , "John W. Linville" , linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch 1/2] iwlwifi: missing unlock on error path Message-ID: <20110315070158.GQ2008@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.6 (demeter1.kernel.org [140.211.167.41]); Tue, 15 Mar 2011 07:02:19 +0000 (UTC) diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 581dc9f..321b18b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c @@ -3009,14 +3009,17 @@ static int iwl_mac_offchannel_tx_cancel_wait(struct ieee80211_hw *hw) mutex_lock(&priv->mutex); - if (!priv->_agn.offchan_tx_skb) - return -EINVAL; + if (!priv->_agn.offchan_tx_skb) { + ret = -EINVAL; + goto unlock; + } priv->_agn.offchan_tx_skb = NULL; ret = iwl_scan_cancel_timeout(priv, 200); if (ret) ret = -EIO; +unlock: mutex_unlock(&priv->mutex); return ret;