From 3476f08bd89d175bb49838d4d19f887d1d821c11 Mon Sep 17 00:00:00 2001 From: Jeevan Kukkalli Date: Fri, 10 Jan 2020 13:40:34 +0530 Subject: [PATCH] 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 --- dp/wifi3.0/dp_rx_mon_status.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dp/wifi3.0/dp_rx_mon_status.c b/dp/wifi3.0/dp_rx_mon_status.c index 0b0ab47676..37db9ba5f6 100644 --- a/dp/wifi3.0/dp_rx_mon_status.c +++ b/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; }