Commit 0f6df02a authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Fix endian abnormality in mlme_evt_hdl23a()

Every other place uses C2HEvent_Header() for events. Given the struct
is endian dependant, use it here too to retrieve data from the parm
buffer.

Note the length field is not set/read in le order - question is
whether it's simply an opaque field?
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d217e5dd
...@@ -6416,13 +6416,13 @@ u8 mlme_evt_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) ...@@ -6416,13 +6416,13 @@ u8 mlme_evt_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{ {
u8 evt_code, evt_seq; u8 evt_code, evt_seq;
u16 evt_sz; u16 evt_sz;
const uint *peventbuf; const struct C2HEvent_Header *c2h;
void (*event_callback)(struct rtw_adapter *dev, u8 *pbuf); void (*event_callback)(struct rtw_adapter *dev, u8 *pbuf);
peventbuf = (uint*)pbuf; c2h = (struct C2HEvent_Header *)pbuf;
evt_sz = (u16)(*peventbuf&0xffff); evt_sz = c2h->len;
evt_seq = (u8)((*peventbuf>>24)&0x7f); evt_seq = c2h->seq;
evt_code = (u8)((*peventbuf>>16)&0xff); evt_code = c2h->ID;
/* checking if event code is valid */ /* checking if event code is valid */
if (evt_code >= MAX_C2HEVT) { if (evt_code >= MAX_C2HEVT) {
...@@ -6438,12 +6438,8 @@ u8 mlme_evt_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) ...@@ -6438,12 +6438,8 @@ u8 mlme_evt_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
goto _abort_event_; goto _abort_event_;
} }
peventbuf += 2; event_callback = wlanevents[evt_code].event_callback;
event_callback(padapter, (u8 *)pbuf + sizeof(struct C2HEvent_Header));
if (peventbuf) {
event_callback = wlanevents[evt_code].event_callback;
event_callback(padapter, (u8*)peventbuf);
}
_abort_event_: _abort_event_:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment