qcacmn: Fix static code analysis issues in DP
In dp_srng_init, max_buffer_length and prefetch_timer are used while uninitialized. In dp_bucket_index, overrunning array cdp_sw_enq_delay leads to out-of-bounds access. In dp_rx_defrag_fraglist_insert, cur is first NULL checked but cur is again set to qdf_nbuf_next and is accessed without NULL check. Thus do a NULL check again before dereferencing cur to avoid potential NULL pointer dereference. In htt_t2h_stats_handler, soc could be NULL while cmn_init_done is dereferenced. Thus fix it by NULL check soc first and then dereference cmn_init_done. Change-Id: Ie6a33347d34862f30ba04a10096d3892af7571d3 CRs-Fixed: 2751573
This commit is contained in:
@@ -2103,10 +2103,16 @@ void htt_t2h_stats_handler(void *context)
|
||||
uint8_t done;
|
||||
uint32_t rem_stats;
|
||||
|
||||
if (!soc || !qdf_atomic_read(&soc->cmn_init_done)) {
|
||||
if (!soc) {
|
||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||
"soc: 0x%pK, init_done: %d", soc,
|
||||
qdf_atomic_read(&soc->cmn_init_done));
|
||||
"soc is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!qdf_atomic_read(&soc->cmn_init_done)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||
"soc: 0x%pK, init_done: %d", soc,
|
||||
qdf_atomic_read(&soc->cmn_init_done));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user