Browse Source

qcacmn: Free peer obj directly if current context is in non-atomic

Free peer object directly if current running context is not in atomic to
make the code much more reasonable and logical.

1. If current running context is not in atomic state, it's safe to call
   peer free object directly.
2. If current running context is in atomic state, then delay this free
   in a work item to avoid scheduling issue.

Change-Id: I9acf97354619ed2b6c09b3f619bd10dc930d8afb
CRs-Fixed: 3412111
Tiger Yu 2 years ago
parent
commit
73d74205f1
1 changed files with 8 additions and 4 deletions
  1. 8 4
      umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c

+ 8 - 4
umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c

@@ -451,12 +451,16 @@ wlan_objmgr_peer_obj_destroy(struct wlan_objmgr_peer *peer)
 {
 	QDF_STATUS status;
 
-	status = wlan_peer_obj_free_enqueue(peer);
-	if (status != QDF_STATUS_SUCCESS) {
-		obj_mgr_warn("enqueue failure, call free obj directly");
-		status = __wlan_objmgr_peer_obj_destroy(peer);
+	if (qdf_in_atomic()) {
+		status = wlan_peer_obj_free_enqueue(peer);
+		if (status == QDF_STATUS_SUCCESS)
+			return status;
+
+		obj_mgr_err("enqueue failure, call free obj directly");
 	}
 
+	status = __wlan_objmgr_peer_obj_destroy(peer);
+
 	return status;
 }