qcacmn: Add check to avoid adf_dp_trace_cb_table over read

The size of adf_dp_trace_cb_table array is 30, possible over
read of adf_dp_trace_cb_table array in adf_dp_add_record API.

Add index condition check for adf_dp_trace_cb_table to avoid
array over read.

CRs-Fixed: 1041684
Change-Id: I4f0f9dda239efd404dff3f92b68a45aaf71875ae
This commit is contained in:
SaidiReddy Yenuga 2016-08-04 19:15:39 +05:30 • committed by c_manjee
commit 186c3da226

View file

@ -1201,7 +1201,8 @@ static void qdf_dp_add_record(enum QDF_DP_TRACE_ID code,
rec->pid = (in_interrupt() ? 0 : current->pid);
spin_unlock_bh(&l_dp_trace_lock);
if (g_qdf_dp_trace_data.live_mode || (print == true))
if ((g_qdf_dp_trace_data.live_mode || (print == true)) &&
(rec->code < QDF_DP_TRACE_MAX))
qdf_dp_trace_cb_table[rec->code] (rec, index);
}