Skip to content

Commit

Permalink
iwlwifi: missing unlock on error path
Browse files Browse the repository at this point in the history
We should unlock here instead of returning -EINVAL directly.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Dan Carpenter authored and John W. Linville committed Mar 21, 2011
1 parent 9011cd2 commit f8a22a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f8a22a2

Please sign in to comment.