From: Dan Carpenter Date: Tue, 15 Mar 2011 07:01:58 +0000 (+0300) Subject: iwlwifi: missing unlock on error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f8a22a2b165c79a46e275097fcadab7fd151c504;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git iwlwifi: missing unlock on error path We should unlock here instead of returning -EINVAL directly. Signed-off-by: Dan Carpenter Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 581dc9f10273..321b18b59135 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;