Skip to content

Commit 5db16ba

Browse files
blogicjmberg-intel
authored andcommitted
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 697f6c5 ("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>
1 parent 9cf0233 commit 5db16ba

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎net/mac80211/he.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ ieee80211_he_spr_ie_to_bss_conf(struct ieee80211_vif *vif,
7272
{
7373
struct ieee80211_he_obss_pd *he_obss_pd =
7474
&vif->bss_conf.he_obss_pd;
75-
const u8 *data = he_spr_ie_elem->optional;
75+
const u8 *data;
7676

7777
memset(he_obss_pd, 0, sizeof(*he_obss_pd));
7878

7979
if (!he_spr_ie_elem)
8080
return;
81+
data = he_spr_ie_elem->optional;
8182

8283
if (he_spr_ie_elem->he_sr_control &
8384
IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT)

0 commit comments

Comments
 (0)