--- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -950,7 +950,12 @@ static void ieee80211_parse_extension_el struct ieee802_11_elems *elems) { const void *data = elem->data + 1; - u8 len = elem->datalen - 1; + u8 len; + + if (!elem->datalen) + return; + + len = elem->datalen - 1; switch (elem->data[0]) { case WLAN_EID_EXT_HE_MU_EDCA: