From ffc6a0439cbb907b3967d1e2f82332ab59d8af93 Mon Sep 17 00:00:00 2001 From: Amir Patel Date: Thu, 3 May 2018 12:55:23 +0530 Subject: [PATCH] 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 --- umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 911b5b4aa061..6e5be4cb927f 100644 --- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_debug.c +++ b/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); }