qcacmn: Fix issues reported by static analysis tool

Add changes to fix issues:
1. Array out of bound access
2. Arithmatic expression overrun

Change-Id: Idf9bdea33422015e0310e57d005f7d6941f8151e
CRs-Fixed: 3298301
This commit is contained in:
Srinivas Girigowda
2022-09-22 18:44:17 -07:00
committed by Madan Koyyalamudi
parent a16d867018
commit 7cb3b7dd47
2 changed files with 32 additions and 0 deletions

View File

@@ -2406,6 +2406,16 @@ dp_peer_update_rx_pkt_per_lmac(struct dp_txrx_peer *txrx_peer,
{
uint8_t lmac_id = qdf_nbuf_get_lmac_id(nbuf);
if (qdf_unlikely(lmac_id >= CDP_MAX_LMACS)) {
dp_err_rl("Invalid lmac_id: %u vdev_id: %u",
lmac_id, QDF_NBUF_CB_RX_VDEV_ID(nbuf));
if (qdf_likely(txrx_peer))
dp_err_rl("peer_id: %u", txrx_peer->peer_id);
return;
}
/* only count stats per lmac for MLO connection*/
DP_PEER_PER_PKT_STATS_INCC_PKT(txrx_peer, rx.rx_lmac[lmac_id], 1,
QDF_NBUF_CB_RX_PKT_LEN(nbuf),