public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/2] iwlwifi: missing unlock on error path
@ 2011-03-15  7:01 Dan Carpenter
  2011-03-15  9:04 ` Guy, Wey-Yi
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-03-15  7:01 UTC (permalink / raw)
  To: Wey-Yi Guy, johannes.berg
  Cc: Intel Linux Wireless, John W. Linville, linux-wireless,
	kernel-janitors

We should unlock here instead of returning -EINVAL directly.

Signed-off-by: Dan Carpenter <error27@gmail.com>

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch 1/2] iwlwifi: missing unlock on error path
  2011-03-15  7:01 [patch 1/2] iwlwifi: missing unlock on error path Dan Carpenter
@ 2011-03-15  9:04 ` Guy, Wey-Yi
  0 siblings, 0 replies; 2+ messages in thread
From: Guy, Wey-Yi @ 2011-03-15  9:04 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Berg, Johannes, Intel Linux Wireless, John W. Linville,
	linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org

On Tue, 2011-03-15 at 00:01 -0700, Dan Carpenter wrote:
> We should unlock here instead of returning -EINVAL directly.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>

> 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;
great catch

Thanks
Wey


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-15  9:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15  7:01 [patch 1/2] iwlwifi: missing unlock on error path Dan Carpenter
2011-03-15  9:04 ` Guy, Wey-Yi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox