Parcourir la source

qcacmn: Fix wrap-around condition check in DIAG_RX_EVENT_RECORD

Diag_log_max_entry should be used to determine wrap around condition
in DIAG_RX_EVENT_RECORD. Using incorrect max value results in invalid
access and memory corruption. Fix DIAG_RX_EVENT_RECORD to use diag_log
max entry instead of mgmt_max entry.

Change-Id: Icae3ce843b1fd76e15139fae1a867448ad032cf8
CRs-Fixed: 2488783
Surya Prakash Raajen il y a 5 ans
Parent
commit
c59f7dc66e
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      wmi/src/wmi_unified.c

+ 1 - 1
wmi/src/wmi_unified.c

@@ -568,7 +568,7 @@ wmi_diag_rx_event_log_buffer[WMI_DIAG_RX_EVENT_DEBUG_MAX_ENTRY];
 } while (0);
 
 #define WMI_DIAG_RX_EVENT_RECORD(h, a, b) do {                             \
-	if (wmi_mgmt_log_max_entry <=                                   \
+	if (wmi_diag_log_max_entry <=                                   \
 		*(h->log_info.wmi_diag_event_log_buf_info.p_buf_tail_idx))\
 		*(h->log_info.wmi_diag_event_log_buf_info.p_buf_tail_idx) = 0;\
 	((struct wmi_event_debug *)h->log_info.wmi_diag_event_log_buf_info.buf)\