Commit 1c955973 authored by Johannes Berg's avatar Johannes Berg

mac80211: remove unnecessary key condition

When we reach this point, the key cannot be NULL. Remove the condition
that suggests otherwise.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20190830112451.21655-6-luca@coelho.fiSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 54626324
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net> * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright 2015-2017 Intel Deutschland GmbH * Copyright 2015-2017 Intel Deutschland GmbH
* Copyright 2018-2019 Intel Corporation
*/ */
#include <linux/if_ether.h> #include <linux/if_ether.h>
...@@ -781,9 +782,8 @@ int ieee80211_key_link(struct ieee80211_key *key, ...@@ -781,9 +782,8 @@ int ieee80211_key_link(struct ieee80211_key *key,
/* The rekey code assumes that the old and new key are using /* The rekey code assumes that the old and new key are using
* the same cipher. Enforce the assumption for pairwise keys. * the same cipher. Enforce the assumption for pairwise keys.
*/ */
if (key && if ((alt_key && alt_key->conf.cipher != key->conf.cipher) ||
((alt_key && alt_key->conf.cipher != key->conf.cipher) || (old_key && old_key->conf.cipher != key->conf.cipher))
(old_key && old_key->conf.cipher != key->conf.cipher)))
goto out; goto out;
} else if (sta) { } else if (sta) {
old_key = key_mtx_dereference(sdata->local, sta->gtk[idx]); old_key = key_mtx_dereference(sdata->local, sta->gtk[idx]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment