diff options
author | John Crispin | 2019-08-13 09:07:12 +0200 |
---|---|---|
committer | Johannes Berg | 2019-08-21 10:58:32 +0200 |
commit | 5db16ba82f38849a78ae932c0b7eada4cd2eb919 (patch) | |
tree | dc70edc5f66fea813a164eeac3764408fbfc89fe | |
parent | 9cf02338880dfc5928e98e3a1200d5aacfa6d1c6 (diff) |
mac80211: fix possible NULL pointerderef in obss pd code
he_spr_ie_elem is dereferenced before the NULL check. fix this by moving
the assignment after the check.
fixes commit 697f6c507c74 ("mac80211: propagate HE operation info into
bss_conf")
This was reported by the static code checker.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John Crispin <john@phrozen.org>
Link: https://lore.kernel.org/r/20190813070712.25509-1-john@phrozen.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/he.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/he.c b/net/mac80211/he.c index a02abfc424aa..736da0035135 100644 --- a/net/mac80211/he.c +++ b/net/mac80211/he.c @@ -72,12 +72,13 @@ ieee80211_he_spr_ie_to_bss_conf(struct ieee80211_vif *vif, { struct ieee80211_he_obss_pd *he_obss_pd = &vif->bss_conf.he_obss_pd; - const u8 *data = he_spr_ie_elem->optional; + const u8 *data; memset(he_obss_pd, 0, sizeof(*he_obss_pd)); if (!he_spr_ie_elem) return; + data = he_spr_ie_elem->optional; if (he_spr_ie_elem->he_sr_control & IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT) |