diff options
author | Johannes Berg <johannes.berg@intel.com> | 2019-08-30 07:24:48 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2019-09-11 03:33:28 -0400 |
commit | 1c9559734eca3dc03a4c805fbf5103349d7a7cf3 (patch) | |
tree | a53fba45403109531e5f2243cfc8a2e5f9952555 /net/mac80211 | |
parent | 5462632488453d170b918a0a95688125d5558289 (diff) |
mac80211: remove unnecessary key condition
When we reach this point, the key cannot be NULL. Remove the condition
that suggests otherwise.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20190830112451.21655-6-luca@coelho.fi
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/key.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 7dfee848abac..1be3686562ee 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -6,6 +6,7 @@ | |||
6 | * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net> | 6 | * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net> |
7 | * Copyright 2013-2014 Intel Mobile Communications GmbH | 7 | * Copyright 2013-2014 Intel Mobile Communications GmbH |
8 | * Copyright 2015-2017 Intel Deutschland GmbH | 8 | * Copyright 2015-2017 Intel Deutschland GmbH |
9 | * Copyright 2018-2019 Intel Corporation | ||
9 | */ | 10 | */ |
10 | 11 | ||
11 | #include <linux/if_ether.h> | 12 | #include <linux/if_ether.h> |
@@ -781,9 +782,8 @@ int ieee80211_key_link(struct ieee80211_key *key, | |||
781 | /* The rekey code assumes that the old and new key are using | 782 | /* The rekey code assumes that the old and new key are using |
782 | * the same cipher. Enforce the assumption for pairwise keys. | 783 | * the same cipher. Enforce the assumption for pairwise keys. |
783 | */ | 784 | */ |
784 | if (key && | 785 | if ((alt_key && alt_key->conf.cipher != key->conf.cipher) || |
785 | ((alt_key && alt_key->conf.cipher != key->conf.cipher) || | 786 | (old_key && old_key->conf.cipher != key->conf.cipher)) |
786 | (old_key && old_key->conf.cipher != key->conf.cipher))) | ||
787 | goto out; | 787 | goto out; |
788 | } else if (sta) { | 788 | } else if (sta) { |
789 | old_key = key_mtx_dereference(sdata->local, sta->gtk[idx]); | 789 | old_key = key_mtx_dereference(sdata->local, sta->gtk[idx]); |