From: Jes Sorensen Date: Sat, 26 Apr 2014 16:54:53 +0000 (+0200) Subject: staging: rtl8723au: rtw_check_beacon_data23a(): Make len unsigned int X-Git-Tag: firefly_0821_release~176^2~3465^2~39^2~1221 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8282aeb63f981a0add994c57a75e472e1ba4f525;p=firefly-linux-kernel-4.4.55.git staging: rtl8723au: rtw_check_beacon_data23a(): Make len unsigned int Making len unsigned int fixes a warning caused by smatch getting confused that len could be negative. Reported-by: Dan Carpenter Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 207a19e4dc9f..77ee182f3e4f 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -783,7 +783,8 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) update_bmc_sta(padapter); } -int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, int len) +int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, + unsigned int len) { int ret = _SUCCESS; u8 *p; @@ -819,7 +820,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, int len) if (!check_fwstate(pmlmepriv, WIFI_AP_STATE)) return _FAIL; - if (len>MAX_IE_SZ) + if (len > MAX_IE_SZ) return _FAIL; pbss_network->IELength = len; diff --git a/drivers/staging/rtl8723au/include/rtw_ap.h b/drivers/staging/rtl8723au/include/rtw_ap.h index 7bcadff02ef9..8d9be5a36eae 100644 --- a/drivers/staging/rtl8723au/include/rtw_ap.h +++ b/drivers/staging/rtl8723au/include/rtw_ap.h @@ -32,7 +32,7 @@ void update_beacon23a(struct rtw_adapter *padapter, u8 ie_id, u8 *oui, u8 tx); void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_level); void expire_timeout_chk23a(struct rtw_adapter *padapter); void update_sta_info23a_apmode23a(struct rtw_adapter *padapter, struct sta_info *psta); -int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, int len); +int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, unsigned int len); void rtw_ap_restore_network(struct rtw_adapter *padapter); void rtw_set_macaddr_acl23a(struct rtw_adapter *padapter, int mode); int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr);