blob: f752d819ca0451d3c5c8fbb091acddb49862409f [file] [log] [blame]
From 8619dfc6206c852b20a5c9b77fa379655801876d Mon Sep 17 00:00:00 2001
From: Luca Coelho <luciano.coelho@intel.com>
Date: Fri, 30 Aug 2019 14:24:50 +0300
Subject: [PATCH] mac80211: don't check if key is NULL in ieee80211_key_link()
commit 753a9a729f84e22b3726f5bf61e1a9b59712d04f upstream.
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>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 157ff5f890d2..baa91b4aacd3 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -781,7 +781,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;
}
--
2.27.0