qcacmn: Set num_user to 0 if peer id is invalid

Peer id field is set to HTT_INVALID_PEER when failed to
populate cdp rx indication structure.Set num_user to 0 in
such cases.This avoids out of bound access during rx stats
update.

Change-Id: I112713deee1ec3cb9c37ba3571aff05fb816c76d
CRs-Fixed: 2596779
This commit is contained in:
Jeevan Kukkalli
2020-01-10 13:40:34 +05:30
committed by nshrivas
parent 94e232827d
commit 3476f08bd8

View File

@@ -340,17 +340,20 @@ dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
ast_index = ppdu_info->rx_status.ast_index;
if (ast_index >= wlan_cfg_get_max_ast_idx(soc->wlan_cfg_ctx)) {
cdp_rx_ppdu->peer_id = HTT_INVALID_PEER;
cdp_rx_ppdu->num_users = 0;
goto end;
}
ast_entry = soc->ast_table[ast_index];
if (!ast_entry) {
cdp_rx_ppdu->peer_id = HTT_INVALID_PEER;
cdp_rx_ppdu->num_users = 0;
goto end;
}
peer = ast_entry->peer;
if (!peer || peer->peer_ids[0] == HTT_INVALID_PEER) {
cdp_rx_ppdu->peer_id = HTT_INVALID_PEER;
cdp_rx_ppdu->num_users = 0;
goto end;
}