From e2bc2c6237f538c4fc3977ff1f5566eb575dd059 Mon Sep 17 00:00:00 2001 From: phadiman Date: Thu, 6 Sep 2018 13:23:09 +0530 Subject: [PATCH] qcacmn: Move qdf_timer_mod inside spinlock wlan_objmgr_insert_ld_obj_to_list is starting the qdf_timer_start within locks when list is empty and during new object is being inserted wlan_objmgr_iterate_log_del_obj_handler was also starting the timer with qdf_timer_mod without locks Both functions tried to modify/start timer and there was already a pending timer running due to race condition between the functions Hence move qdf_timer_mod inside spinlock to gain access to timers atomically CRs-Fixed: 2437930 Change-Id: If7d0b4b56372e14b20768a9a7a6da3c3f5095d7d --- umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c index d875244700f1..c9aa2b7cb166 100644 --- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c +++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c @@ -282,16 +282,14 @@ static void wlan_objmgr_iterate_log_del_obj_handler(void *timer_arg) break; } if (!macaddr) { - qdf_spin_unlock_bh(&debug_info->list_lock); obj_mgr_err("macaddr is null"); QDF_BUG(0); - goto modify_timer; + break; } if (!obj_name) { - qdf_spin_unlock_bh(&debug_info->list_lock); obj_mgr_err("obj_name is null"); QDF_BUG(0); - goto modify_timer; + break; } obj_mgr_alert("#%s in L-state,MAC: " QDF_MAC_ADDR_STR, @@ -301,11 +299,8 @@ static void wlan_objmgr_iterate_log_del_obj_handler(void *timer_arg) } while (QDF_IS_STATUS_SUCCESS(status)); - qdf_spin_unlock_bh(&debug_info->list_lock); - -modify_timer: - /* modify timer timeout value */ qdf_timer_mod(&debug_info->obj_timer, LOG_DEL_OBJ_TIMEOUT_VALUE_MSEC); + qdf_spin_unlock_bh(&debug_info->list_lock); } void wlan_objmgr_debug_info_deinit(void)