rtl8188eu: Fix most errors from smatch

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2015-03-10 11:18:03 -05:00
parent ee006634cb
commit 993b4435cb
40 changed files with 1508 additions and 2204 deletions

View file

@ -556,18 +556,14 @@ static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptabl
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
u8 *pframe = precv_frame->u.hdr.rx_data;
if(ptable->func)
{
if(ptable->func) {
/* receive the frames that ra(a1) is my address or ra(a1) is bc address. */
if (!_rtw_memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) &&
!_rtw_memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN))
{
return;
}
ptable->func(padapter, precv_frame);
}
}
void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
@ -1813,25 +1809,17 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
if (pstapriv->sta_aid[pstat->aid - 1] == NULL)
break;
/* if (pstat->aid > NUM_STA) { */
if (pstat->aid > pstapriv->max_num_sta) {
pstat->aid = 0;
DBG_871X(" no room for more AIDs\n");
status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
goto OnAssocReqFail;
} else {
pstapriv->sta_aid[pstat->aid - 1] = pstat;
DBG_871X("allocate new AID = (%d)\n", pstat->aid);
}
}
pstat->state &= (~WIFI_FW_ASSOC_STATE);
pstat->state |= WIFI_FW_ASSOC_SUCCESS;
@ -2999,7 +2987,7 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8* raddr, u8* frame
p2pie[ p2pielen++ ] = P2P_ATTR_STATUS;
/* Length: */
*(__le16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 );
*(__le16*) ( p2pie + p2pielen ) = cpu_to_le16( 0x0001 );
p2pielen += 2;
/* Value: */
@ -4121,16 +4109,14 @@ static u8 is_matched_in_profilelist( u8* peermacaddr, struct profile_info* profi
for( i = 0; i < P2P_MAX_PERSISTENT_GROUP_NUM; i++, profileinfo++ )
{
DBG_871X( "[%s] profileinfo_mac = %.2X %.2X %.2X %.2X %.2X %.2X\n", __FUNCTION__,
DBG_871X( "[%s] profileinfo_mac = %.2X %.2X %.2X %.2X %.2X %.2X\n", __FUNCTION__,
profileinfo->peermac[0], profileinfo->peermac[1],profileinfo->peermac[2],profileinfo->peermac[3],profileinfo->peermac[4],profileinfo->peermac[5]);
if ( _rtw_memcmp( peermacaddr, profileinfo->peermac, ETH_ALEN ) )
{
if ( _rtw_memcmp( peermacaddr, profileinfo->peermac, ETH_ALEN ) ) {
match_result = 1;
DBG_871X( "[%s] Match!\n", __FUNCTION__ );
break;
}
}
return (match_result );
}
@ -4923,7 +4909,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame)
/* Commented by Kurt 20120113 */
/* Get peer_dev_addr here if peer doesn't issue prov_disc frame. */
if( _rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN) );
if( _rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN) )
memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN);
result = process_p2p_group_negotation_req( pwdinfo, frame_body, len );
@ -5613,7 +5599,7 @@ s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntfr
pxmitbuf->sctx = NULL;
_exit_critical(&pxmitpriv->lock_sctx, &irqL);
return ret;
return ret;
}
s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmgntframe)
@ -5641,7 +5627,7 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg
pxmitpriv->ack_tx = false;
_exit_critical_mutex(&pxmitpriv->ack_tx_mutex, NULL);
return ret;
return ret;
}
static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode)
@ -8627,9 +8613,10 @@ void start_clnt_join(struct adapter* padapter)
for (pos = get_next(head);!rtw_end_of_queue_search(head, pos); pos = get_next(pos)) {
scanned = LIST_CONTAINOR(pos, struct wlan_network, list);
if(scanned==NULL)
if(scanned==NULL) {
rtw_warn_on(1);
return;
}
if (_rtw_memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID)) == true
&& _rtw_memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS)) == true
) {
@ -9541,11 +9528,10 @@ void mlmeext_sta_del_event_callback(struct adapter *padapter)
Following are the functions for the timer handlers
*****************************************************************************/
void _linked_rx_signal_strehgth_display(struct adapter *padapter);
void _linked_rx_signal_strehgth_display(struct adapter *padapter)
{
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 mac_id;
int UndecoratedSmoothedPWDB;
if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
@ -10200,8 +10186,6 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c
/* acquire channels from in */
j = 0;
for (i=0;i<in_num;i++) {
if (0)
DBG_871X(FUNC_ADPT_FMT" "CHAN_FMT"\n", FUNC_ADPT_ARG(padapter), CHAN_ARG(&in[i]));
if(in[i].hw_value && !(in[i].flags & RTW_IEEE80211_CHAN_DISABLED)
&& (set_idx=rtw_ch_set_search_ch(pmlmeext->channel_set, in[i].hw_value)) >=0
)
@ -10588,20 +10572,15 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf)
peventbuf += 2;
if(peventbuf)
{
if(peventbuf) {
event_callback = wlanevents[evt_code].event_callback;
event_callback(padapter, (u8*)peventbuf);
pevt_priv->evt_done_cnt++;
}
_abort_event_:
return H2C_SUCCESS;
}
u8 h2c_msg_hdl(struct adapter *padapter, unsigned char *pbuf)