Re: [patch 1/2] iwlwifi: missing unlock on error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> Acked-by: Wey-Yi Guy <wey-yi.w.guy@xxxxxxxxx>

> 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

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux