Linux-Wireless Archive on
 help / color / Atom feed
* [PATCH] mac80211: fix possible NULL pointerderef in obss pd code
@ 2019-08-13  7:07 John Crispin
  0 siblings, 0 replies; only message in thread
From: John Crispin @ 2019-08-13  7:07 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, John Crispin, Dan Carpenter

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

This was reported by the static code checker.

Reported-by: Dan Carpenter <>
Signed-off-by: John Crispin <>
 net/mac80211/he.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 =
-	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)
+	data = he_spr_ie_elem->optional;
 	if (he_spr_ie_elem->he_sr_control &

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13  7:07 [PATCH] mac80211: fix possible NULL pointerderef in obss pd code John Crispin

Linux-Wireless Archive on

Archives are clonable:
	git clone --mirror linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ \
	public-inbox-index linux-wireless

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox