Browse Source

qcacmn: Panic on uninitialized lock destroy

Currently, if an uninitialized QDF mutex or spinlock is destroyed, the
issue is logged in dmesg. This has allowed multiple uninitialized
spinlock issues to merge into mainline and remain unnoticed for several
weeks. Instead, if an uninitialized lock is detected during destroy,
panic.

Change-Id: I929cfa3f295cb1e76634653bbd4aec3a6f1268b7
CRs-Fixed: 2347717
Dustin Brown 6 years ago
parent
commit
75e3c8cc7e
1 changed files with 2 additions and 4 deletions
  1. 2 4
      qdf/linux/src/qdf_lock.c

+ 2 - 4
qdf/linux/src/qdf_lock.c

@@ -855,10 +855,8 @@ void qdf_lock_stats_cookie_destroy(struct lock_stats *stats)
 {
 	struct qdf_lock_cookie *cookie = stats->cookie;
 
-	if (cookie == NULL) {
-		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
-			  "%s: Double cookie destroy", __func__);
-		QDF_ASSERT(0);
+	if (!cookie) {
+		QDF_DEBUG_PANIC("Lock destroyed twice or never created");
 		return;
 	}