Kaynağa Gözat

qcacmn: Add spinlock release API in objmgr debug code

Spinlock is locked but not unlocked in objmgr debug code,
this leads to deadlock.
To avoid, while iterating over logically deleted nodes,
if macaddr is NULL (macaddr could be NULL, either due object
memory corruption or object itself is NULL) release list lock
and raise BUG(). Also if name of object (psoc/pdev/vdev/peer)
is NULL (object name could be NULL, if obj_type passed while
adding object to logically deleted list is >= WLAN_OBJ_TYPE_MAX)
release list lock and raise BUG()

CRs-Fixed: 2233619
Change-Id: Ib6a67817234bf352b6e3a57360db0c082be19430
Amir Patel 7 yıl önce
ebeveyn
işleme
ffc6a0439c

+ 7 - 2
umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c

@@ -282,12 +282,16 @@ 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");
-			return;
+			QDF_BUG(0);
+			goto modify_timer;
 		}
 		if (!obj_name) {
+			qdf_spin_unlock_bh(&debug_info->list_lock);
 			obj_mgr_err("obj_name is null");
-			return;
+			QDF_BUG(0);
+			goto modify_timer;
 		}
 
 		obj_mgr_alert("#%s in L-state,MAC: " QDF_MAC_ADDR_STR,
@@ -299,6 +303,7 @@ static void wlan_objmgr_iterate_log_del_obj_handler(void *timer_arg)
 
 	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);
 }