From c59f7dc66ee2ada08f90786d24a821c851ee821e Mon Sep 17 00:00:00 2001 From: Surya Prakash Raajen Date: Fri, 12 Jul 2019 11:53:03 +0530 Subject: [PATCH] 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 --- wmi/src/wmi_unified.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index a19afac3730a..ccc685c40e98 100644 --- a/wmi/src/wmi_unified.c +++ b/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)\