]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: cfg80211/mac80211: Fix ML element common size calculation
authorIlan Peer <ilan.peer@intel.com>
Wed, 7 Sep 2022 14:23:09 +0000 (17:23 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 7 Oct 2022 13:23:52 +0000 (15:23 +0200)
The common size is part of the length in the data
so don't add it again.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/linux/ieee80211.h

index bdf668f9dace9905d1a212f7aa25e7780f522d85..442b13333da8a30e0f31497130206e0960faed1d 100644 (file)
@@ -4573,18 +4573,17 @@ static inline u8 ieee80211_mle_common_size(const u8 *data)
 
        switch (u16_get_bits(control, IEEE80211_ML_CONTROL_TYPE)) {
        case IEEE80211_ML_CONTROL_TYPE_BASIC:
-               common += sizeof(struct ieee80211_mle_basic_common_info);
-               break;
        case IEEE80211_ML_CONTROL_TYPE_PREQ:
-               common += sizeof(struct ieee80211_mle_preq_common_info);
+       case IEEE80211_ML_CONTROL_TYPE_TDLS:
+               /*
+                * The length is the first octet pointed by mle->variable so no
+                * need to add anything
+                */
                break;
        case IEEE80211_ML_CONTROL_TYPE_RECONF:
                if (control & IEEE80211_MLC_RECONF_PRES_MLD_MAC_ADDR)
                        common += ETH_ALEN;
                return common;
-       case IEEE80211_ML_CONTROL_TYPE_TDLS:
-               common += sizeof(struct ieee80211_mle_tdls_common_info);
-               break;
        case IEEE80211_ML_CONTROL_TYPE_PRIO_ACCESS:
                if (control & IEEE80211_MLC_PRIO_ACCESS_PRES_AP_MLD_MAC_ADDR)
                        common += ETH_ALEN;