Prechádzať zdrojové kódy

qcacmn: Fix for qdf spinlock destroyed twice or never created

Fix for qdf_spinlock_destroy being destroyed twice or never created.

Change-Id: Id2a471c7f1efbdba5b31dfc106263c587dae2c1a
CRs-Fixed: 3471529
Naveen S 2 rokov pred
rodič
commit
1aacf20138

+ 5 - 1
target_if/cfr/src/target_if_cfr_enh.c

@@ -2267,6 +2267,7 @@ QDF_STATUS cfr_enh_init_pdev(struct wlan_objmgr_psoc *psoc,
 	}
 
 	qdf_spinlock_create(&pcfr->lut_lock);
+	pcfr->lut_lock_initialised = true;
 
 	return status;
 }
@@ -2329,7 +2330,10 @@ QDF_STATUS cfr_enh_deinit_pdev(struct wlan_objmgr_psoc *psoc,
 	if (status != QDF_STATUS_SUCCESS)
 		cfr_err("Failed to unregister phase delta handler");
 
-	qdf_spinlock_destroy(&pcfr->lut_lock);
+	if (pcfr->lut_lock_initialised) {
+		qdf_spinlock_destroy(&pcfr->lut_lock);
+		pcfr->lut_lock_initialised = false;
+	}
 
 	return status;
 }

+ 2 - 0
umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h

@@ -566,6 +566,7 @@ struct nl_event_cb {
  * CFR_CAPTURE_METHOD_PROBE_RESPONSE
  * @nl_cb: call back to register for nl event for cfr data
  * @lut_lock: Lock to protect access to cfr lookup table
+ * @lut_lock_initialised: Check lut_lock initialised or not.
  * @is_prevent_suspend: CFR wake lock acquired or not
  * @wake_lock: wake lock for cfr
  * @runtime_lock: runtime lock for cfr
@@ -624,6 +625,7 @@ struct pdev_cfr {
 	struct unassoc_pool_entry unassoc_pool[MAX_CFR_ENABLED_CLIENTS];
 	struct nl_event_cb nl_cb;
 	qdf_spinlock_t lut_lock;
+	bool lut_lock_initialised;
 #ifdef WLAN_CFR_PM
 	bool is_prevent_suspend;
 	qdf_wake_lock_t wake_lock;