From 510e4e2de7c7f9abaab3397ff30fc13bc6eb5063 Mon Sep 17 00:00:00 2001 From: Li Feng Date: Tue, 17 Sep 2019 10:42:37 +0800 Subject: [PATCH] qcacmn: Initialize __log_window_end_ticks variable explicitly The __log_window_end_ticks variable is implicitly initialized as zero, which may lead to the disfunction of qdf_system_time_after when assert_on_excessive_logging is first called with big number jiffies. Then __log_window_count number increase until hit the threshold, and trigger the panic. Now initialize __log_window_end_ticks variable explicitly when __log_window_count is initial zero in the first call of assert_on_excessive_logging. Change-Id: Ic5256af9235bf195b4ae5ee79bfce9ea213ea29b CRs-Fixed: 2525529 --- utils/logging/src/wlan_logging_sock_svc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/logging/src/wlan_logging_sock_svc.c b/utils/logging/src/wlan_logging_sock_svc.c index 0c4e752500..3822db12c0 100644 --- a/utils/logging/src/wlan_logging_sock_svc.c +++ b/utils/logging/src/wlan_logging_sock_svc.c @@ -313,7 +313,9 @@ static void assert_on_excessive_logging(void) * Note: This is not thread safe, and can result in more than one reset. * For our purposes, this is fine. */ - if (qdf_system_time_after(now, __log_window_end_ticks)) { + if (!qdf_atomic_read(&__log_window_count)) { + __log_window_end_ticks = now + qdf_system_ticks_per_sec; + } else if (qdf_system_time_after(now, __log_window_end_ticks)) { __log_window_end_ticks = now + qdf_system_ticks_per_sec; qdf_atomic_set(&__log_window_count, 0); }