lkml.org 
[lkml]   [2020]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 04/17] staging: wfx: fix wrong bytes order
Date
From: Jérôme Pouiller <jerome.pouiller@silabs.com>

The field wakeup_period_max from struct hif_mib_beacon_wake_up_period is
a u8. So, assigning it a __le16 produces a nasty bug on big-endian
architectures.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
drivers/staging/wfx/hif_tx_mib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wfx/hif_tx_mib.c b/drivers/staging/wfx/hif_tx_mib.c
index 65381b22437e..567c61d1fe2e 100644
--- a/drivers/staging/wfx/hif_tx_mib.c
+++ b/drivers/staging/wfx/hif_tx_mib.c
@@ -32,7 +32,7 @@ int hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
struct hif_mib_beacon_wake_up_period val = {
.wakeup_period_min = dtim_interval,
.receive_dtim = 0,
- .wakeup_period_max = cpu_to_le16(listen_interval),
+ .wakeup_period_max = listen_interval,
};

if (dtim_interval > 0xFF || listen_interval > 0xFFFF)
--
2.26.2
\
 
 \ /
  Last update: 2020-05-12 17:07    [W:0.132 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site