浏览代码

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
Jeevan Kukkalli 5 年之前
父节点
当前提交
3476f08bd8
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      dp/wifi3.0/dp_rx_mon_status.c

+ 3 - 0
dp/wifi3.0/dp_rx_mon_status.c

@@ -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;
 	}