Browse Source

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
phadiman 6 years ago
parent
commit
e2bc2c6237
1 changed files with 3 additions and 8 deletions
  1. 3 8
      umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c

+ 3 - 8
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)