From d7a380b2b3d748362c25da8e356ce4fe8ab316ce Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 4 Sep 2013 15:55:54 -0500 Subject: 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 Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/staging/rtl8188eu/include/rtw_mlme_ext.h') 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_ */ -- cgit v1.2.3 From f7bba924ed74d1811345f7be68d3e802339068de Mon Sep 17 00:00:00 2001 From: Masanari Iida Date: Fri, 27 Sep 2013 00:11:43 +0900 Subject: staging: rtl8188eu: Fix typo in rtl8188eu/include Correct spelling typo in rtl8188eu/include Signed-off-by: Masanari Iida Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/include/rtw_mlme_ext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/rtl8188eu/include/rtw_mlme_ext.h') diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h index 853ab80a2b86..b1bfa2e30fdb 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h @@ -107,7 +107,7 @@ extern unsigned char WMM_PARA_OUI[]; /* Note: */ /* We just add new channel plan when the new channel plan is different * from any of the following channel plan. */ -/* If you just wnat to customize the acitions(scan period or join actions) +/* If you just want to customize the actions(scan period or join actions) * about one of the channel plan, */ /* customize them in struct rt_channel_info in the RT_CHANNEL_LIST. */ enum RT_CHANNEL_DOMAIN { -- cgit v1.2.3