From: Johannes Berg Date: Sat, 17 Sep 2022 01:14:53 +0000 (+0200) Subject: wifi: fix multi-link element subelement iteration X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=4c880f3f535068a9760f666b813a879a9b43ed1b;p=carl9170fw.git wifi: fix multi-link element subelement iteration The subelements obviously start after the common data, including the common multi-link element structure definition itself. This bug was possibly just hidden by the higher bits of the control being set to 0, so the iteration just found one bogus element and most of the code could continue anyway. Fixes: 0f48b8b88aa9 ("wifi: ieee80211: add definitions for multi-link element") Signed-off-by: Johannes Berg Signed-off-by: Christian Lamparter --- diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index a4e66d4..23a8a1e 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -4521,7 +4521,7 @@ static inline u8 ieee80211_mle_common_size(const u8 *data) return 0; } - return common + mle->variable[0]; + return sizeof(*mle) + common + mle->variable[0]; } /**