Skip to content

Commit

Permalink
mac80211: don't check if key is NULL in ieee80211_key_link()
Browse files Browse the repository at this point in the history
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: 96fc6ef ("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>
  • Loading branch information
Luca Coelho authored and Johannes Berg committed Sep 11, 2019
1 parent 624ff4b commit 753a9a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mac80211/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 753a9a7

Please sign in to comment.