driver_nl80211: use correct u8 size for NL80211_ATTR_SMPS_MODE

Message ID 20181026135048.18002-1-johannes@sipsolutions.net
State New
Headers show
Series
  • driver_nl80211: use correct u8 size for NL80211_ATTR_SMPS_MODE
Related show

Commit Message

Johannes Berg Oct. 26, 2018, 1:50 p.m.
From: Johannes Berg <johannes.berg@intel.com>

Back in December 2017, Jouni fixed the output side since that was
causing a kernel message to be printed, but the input side should
also be fixed, otherwise it will not work correctly on big-endian
platforms.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 src/drivers/driver_nl80211_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 5b8efbc172cb..bac83898db90 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -2271,7 +2271,7 @@  static void nl80211_sta_opmode_change_event(struct wpa_driver_nl80211_data *drv,
 	ed.sta_opmode.addr = nla_data(tb[NL80211_ATTR_MAC]);
 
 	if (tb[NL80211_ATTR_SMPS_MODE]) {
-		smps_mode = nla_get_u32(tb[NL80211_ATTR_SMPS_MODE]);
+		smps_mode = nla_get_u8(tb[NL80211_ATTR_SMPS_MODE]);
 		switch (smps_mode) {
 		case NL80211_SMPS_OFF:
 			ed.sta_opmode.smps_mode = SMPS_OFF;