[RFC PATCH 07/12] wifi: mac80211: remove lookup_key() dead code

Johannes Berg <[email protected]> Sat, 1 Aug 2026 09:58:23 +0200
Newsgroups org.kernel.vger.linux-wireless
Message-ID <20260801095822.ff05a3ced550.I32022329526347cbf8a13b69a2ece1c2ee1b0261@changeid>
From: Johannes Berg <[email protected]>

This code path can never be exercised because pairwise
requires mac_addr set, so the code exited prior to it
being reached here.

Signed-off-by: Johannes Berg <[email protected]>
---
 net/mac80211/cfg.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 31c3b7481204..c0a5d9a7b1d0 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -798,9 +798,6 @@ ieee80211_lookup_key(struct ieee80211_sub_if_data *sdata, int link_id,
 		return NULL;
 	}
 
-	if (pairwise && key_idx < NUM_DEFAULT_KEYS)
-		return wiphy_dereference(local->hw.wiphy, sdata->keys[key_idx]);
-
 	if (cigtk)
 		return wiphy_dereference(local->hw.wiphy,
 					 link->tx_cigtk[key_idx]);
-- 
2.55.0