summaryrefslogtreecommitdiffstats
path: root/net/mac80211/key.c
diff options
context:
space:
mode:
authorLuca Coelho <luciano.coelho@intel.com>2019-08-30 13:24:50 +0200
committerJohannes Berg <johannes.berg@intel.com>2019-09-11 09:33:28 +0200
commit753a9a729f84e22b3726f5bf61e1a9b59712d04f (patch)
tree0b1fa363fe0b2111250caf7000a768bbb518d7d4 /net/mac80211/key.c
parentmac80211: clear crypto tx tailroom counter upon keys enable (diff)
downloadlinux-753a9a729f84e22b3726f5bf61e1a9b59712d04f.tar.xz
linux-753a9a729f84e22b3726f5bf61e1a9b59712d04f.zip
mac80211: don't check if key is NULL in ieee80211_key_link()
We already assume that key is not NULL and dereference it in a few other places before we check whether it is NULL, so the check is unnecessary. Remove it. Fixes: 96fc6efb9ad9 ("mac80211: IEEE 802.11 Extended Key ID support") Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/20190830112451.21655-8-luca@coelho.fi Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/key.c')
-rw-r--r--net/mac80211/key.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 93ea03b86b80..0f889b919b06 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -793,7 +793,7 @@ int ieee80211_key_link(struct ieee80211_key *key,
/* Non-pairwise keys must also not switch the cipher on rekey */
if (!pairwise) {
- if (key && old_key && old_key->conf.cipher != key->conf.cipher)
+ if (old_key && old_key->conf.cipher != key->conf.cipher)
goto out;
}