diff mbox

rsi: fix a bug in rsi_hal_key_config()

Message ID 20180427112130.GA27655@mwanda (mailing list archive)
State Rejected
Delegated to: Kalle Valo
Headers show

Commit Message

Dan Carpenter April 27, 2018, 11:21 a.m. UTC
Smatch complains that the end of this function is dead code.  I'm pretty
sure that this return needs to be changed to only return on error.

Fixes: 4fd6c4762f37 ("rsi: roaming enhancements")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Kalle Valo April 27, 2018, 11:32 a.m. UTC | #1
Dan Carpenter <dan.carpenter@oracle.com> writes:

> Smatch complains that the end of this function is dead code.  I'm pretty
> sure that this return needs to be changed to only return on error.
>
> Fixes: 4fd6c4762f37 ("rsi: roaming enhancements")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
> index 766d874cc6e2..80e7f4f4f188 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
> @@ -911,14 +911,14 @@ static int rsi_hal_key_config(struct ieee80211_hw *hw,
>  		}
>  	}
>  
> -	return rsi_hal_load_key(adapter->priv,
> -				key->key,
> -				key->keylen,
> -				key_type,
> -				key->keyidx,
> -				key->cipher,
> -				sta_id,
> -				vif);
> +	status = rsi_hal_load_key(adapter->priv,
> +				  key->key,
> +				  key->keylen,
> +				  key_type,
> +				  key->keyidx,
> +				  key->cipher,
> +				  sta_id,
> +				  vif);

Gustavo submitted an identical patch also for this one :)

https://patchwork.kernel.org/patch/10365997/
Dan Carpenter April 27, 2018, 11:44 a.m. UTC | #2
On Fri, Apr 27, 2018 at 02:32:20PM +0300, Kalle Valo wrote:
> 
> Gustavo submitted an identical patch also for this one :)
> 
> https://patchwork.kernel.org/patch/10365997/
> 

Hey Gustavo,

We keep on sending duplicate patches.  Most of the static checker people
CC kernel-janitors@vger.kernel.org so we can see what's already been
sent.

regards,
dan carpenter
Gustavo A. R. Silva April 27, 2018, 1:45 p.m. UTC | #3
Hi Dan,

On 04/27/2018 06:44 AM, Dan Carpenter wrote:
> On Fri, Apr 27, 2018 at 02:32:20PM +0300, Kalle Valo wrote:
>>
>> Gustavo submitted an identical patch also for this one :)
>>
>> https://patchwork.kernel.org/patch/10365997/
>>
> 
> Hey Gustavo,
> 
> We keep on sending duplicate patches.  Most of the static checker people
> CC kernel-janitors@vger.kernel.org so we can see what's already been
> sent.
> 

Oh, I didn't know that.  I'll start CCing that list then.

Thanks for letting me know.
--
Gustavo
diff mbox

Patch

diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index 766d874cc6e2..80e7f4f4f188 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -911,14 +911,14 @@  static int rsi_hal_key_config(struct ieee80211_hw *hw,
 		}
 	}
 
-	return rsi_hal_load_key(adapter->priv,
-				key->key,
-				key->keylen,
-				key_type,
-				key->keyidx,
-				key->cipher,
-				sta_id,
-				vif);
+	status = rsi_hal_load_key(adapter->priv,
+				  key->key,
+				  key->keylen,
+				  key_type,
+				  key->keyidx,
+				  key->cipher,
+				  sta_id,
+				  vif);
 	if (status)
 		return status;