]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
mac80211: remove useless NULL checks
authorEytan Lifshitz <eytan.lifshitz@intel.com>
Mon, 21 Jul 2014 12:18:41 +0000 (15:18 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 21 Jul 2014 14:04:27 +0000 (16:04 +0200)
sdata can't be NULL, and key being NULL is really not possible
unless the code is modified.

The sdata check made a static analyze (klocwork) unhappy because
we would get pointer to local (sdata->local) and only then check
if sdata is non-NULL.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
[remove !key check as well]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/key.c

index 16d97f044a202e61020f3ef563941e4c9adace0a..d808cff8015374ddfb927d5695a3d3973bcc0428 100644 (file)
@@ -482,9 +482,6 @@ int ieee80211_key_link(struct ieee80211_key *key,
        int idx, ret;
        bool pairwise;
 
-       if (WARN_ON(!sdata || !key))
-               return -EINVAL;
-
        pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE;
        idx = key->conf.keyidx;
        key->local = sdata->local;