Skip to contentSkip to conversation

rsi: fix a bug in rsi_hal_key_config()

PATCH In review Dan Carpenter 3 participants 4 messages Apr 27, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rsi: fix a bug in rsi_hal_key_config()

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")
drivers/net/wireless/rsi/rsi_91x_mac80211.c +8 -8
index 766d874cc6e2..80e7f4f4f188 100644
@@ -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;
 
#1 lore raw
Quoted 20 lines · Dan Carpenter

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")
drivers/net/wireless/rsi/rsi_91x_mac80211.c +0 -6
index 766d874cc6e2..80e7f4f4f188 100644
@@ -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,

drivers/net/wireless/rsi/rsi_91x_mac80211.c static int rsi_hal_key_config(struct ieee80211_hw *hw, · line 921

Quoted 10 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c +8 -2
-				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/

Signature · 1 line
Kalle Valo
#3 lore raw

Hi Dan,

Quoted 4 lines · Dan Carpenter
Quoted 3 lines · Kalle Valo

Gustavo submitted an identical patch also for this one :)

Quoted 9 lines
Quoted 2 lines

https://patchwork.kernel.org/patch/10365997/

Hey Gustavo,

We keep on sending duplicate patches. Most of the static checker people CC [email protected] 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