Skip to content

Commit 575a97a

Browse files
committed
ieee80211: fix HE SPR size calculation
The he_sr_control field is just a u8, so le32_to_cpu() shouldn't be applied to it; this was evidently copied from ieee80211_he_oper_size(). Fix it, and also adjust the type of the local variable. Fixes: ef11a93 ("mac80211: HE: add Spatial Reuse element parsing support") Signed-off-by: Johannes Berg <[email protected]> Link: https://lore.kernel.org/r/20200325090918.dfe483b49e06.Ia53622f23b2610a2ae6ea39a199866196fe946c1@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 0016d32 commit 575a97a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/ieee80211.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,14 +2102,14 @@ ieee80211_he_spr_size(const u8 *he_spr_ie)
21022102
{
21032103
struct ieee80211_he_spr *he_spr = (void *)he_spr_ie;
21042104
u8 spr_len = sizeof(struct ieee80211_he_spr);
2105-
u32 he_spr_params;
2105+
u8 he_spr_params;
21062106

21072107
/* Make sure the input is not NULL */
21082108
if (!he_spr_ie)
21092109
return 0;
21102110

21112111
/* Calc required length */
2112-
he_spr_params = le32_to_cpu(he_spr->he_sr_control);
2112+
he_spr_params = he_spr->he_sr_control;
21132113
if (he_spr_params & IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT)
21142114
spr_len++;
21152115
if (he_spr_params & IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT)

0 commit comments

Comments
 (0)