aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8188eu
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2013-09-04 15:55:54 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-17 07:47:44 -0700
commitd7a380b2b3d748362c25da8e356ce4fe8ab316ce (patch)
treef3ab33fbfb0faaf93aec4b3d92d41c0e22dc7430 /drivers/staging/rtl8188eu
parentstaging: r8188eu: Fix Smatch off-by-one warning in hal/rtl8188e_hal_init.c (diff)
downloadlinux-dev-d7a380b2b3d748362c25da8e356ce4fe8ab316ce.tar.xz
linux-dev-d7a380b2b3d748362c25da8e356ce4fe8ab316ce.zip
staging: r8188eu: Fix smatch error in core/rtw_mlme_ext.c
Smatch reports the following warning: "drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:8328 mlme_evt_hdl() error: buffer overflow 'wlanevents' 24 <= 24" 8321 /* checking if event code is valid */ 8322 if (evt_code >= MAX_C2HEVT) { ^^^^^^^^^^^^^^^^^^^^^^ 8323 RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nEvent Code(%d) mismatch!\n", evt_code)); 8324 goto _abort_event_; 8325 } 8326 8327 /* checking if event size match the event parm size */ 8328 if ((wlanevents[evt_code].parmsize != 0) && ^^^^^^^^^^^^^^^^^^^^ 8329 (wlanevents[evt_code].parmsize != evt_sz)) { 8330 RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, 8331 ("\nEvent(%d) Parm Size mismatch (%d vs %d)!\n", 8332 evt_code, wlanevents[evt_code].parmsize, evt_sz)); 8333 goto _abort_event_; 8334 } This warning results because the number of items in "enum rtw_c2h_event", which determines the value of MAX_C2HEVT, is one more than in "struct wlanevents". Adding an extra dummy event to the latter fixes the problem. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r--drivers/staging/rtl8188eu/include/rtw_mlme_ext.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
index a96b018e5e6a..853ab80a2b86 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
@@ -870,6 +870,7 @@ static struct fwevent wlanevents[] = {
{0, NULL},
{0, NULL},
{0, &rtw_cpwm_event_callback},
+ {0, NULL},
};
#endif/* _RTL_MLME_EXT_C_ */