staging: rtl8723au: rtw_check_beacon_data23a(): Make len unsigned int
authorJes Sorensen <Jes.Sorensen@redhat.com>
Sat, 26 Apr 2014 16:54:53 +0000 (18:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Apr 2014 17:16:12 +0000 (10:16 -0700)
Making len unsigned int fixes a warning caused by smatch getting
confused that len could be negative.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_ap.c
drivers/staging/rtl8723au/include/rtw_ap.h

index 207a19e4dc9f1c7ecbb2fcbe02c286e4e8e90832..77ee182f3e4f8a334e54fd453e1f89a5cfd89fc8 100644 (file)
@@ -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;
index 7bcadff02ef9822d69fcf08445968d501f870146..8d9be5a36eae760105bfd9c182935c03dca3a0dc 100644 (file)
@@ -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);