Commit a2b5fd29 authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

staging: r8188eu: fix the index check in mgt_dispatcher

In mgt_dispatcher, we check that index is a valid index for the
mlme_sta_tbl array. The valid indices for this array are from 0 to
ARRAY_SIZE(mlme_sta_tbl) - 1.

An invalid index is >= ARRAY_SIZE(mlme_sta_tbl). Fix the off by one error
in the check.

Fixes: db84803c ("staging: r8188eu: use ARRAY_SIZE for mlme_sta_tbl")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220422140958.239767-1-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e36c9c00
...@@ -398,7 +398,7 @@ void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame) ...@@ -398,7 +398,7 @@ void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame)
return; return;
index = (le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_STYPE) >> 4; index = (le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_STYPE) >> 4;
if (index > ARRAY_SIZE(mlme_sta_tbl)) if (index >= ARRAY_SIZE(mlme_sta_tbl))
return; return;
fct = mlme_sta_tbl[index]; fct = mlme_sta_tbl[index];
......
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