Browse Source

qcacld-3.0: Disable scheduler before flushing the queues

Currently scheduler thread messages are flushed as part of
deinit but during stop_modules some messages are posted to
scheduler which leads to memory leak.

Disable the scheduler thread processing before flushing the
messages.

Change-Id: I6a9314ef7f4789e5c2f09c5e98f89035f13f5fe1
CRs-Fixed: 3497373
Aravind Kishore Sukla 1 year ago
parent
commit
20c88bcc42
1 changed files with 7 additions and 8 deletions
  1. 7 8
      core/cds/src/cds_api.c

+ 7 - 8
core/cds/src/cds_api.c

@@ -1413,9 +1413,13 @@ QDF_STATUS cds_post_disable(void)
 
 	/* flush any unprocessed scheduler messages */
 	sched_ctx = scheduler_get_context();
-	if (sched_ctx)
-		scheduler_queues_flush(sched_ctx);
-
+	if (sched_ctx) {
+		qdf_status = scheduler_disable();
+		if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
+			cds_err("Failed to disable scheduler");
+			return QDF_STATUS_E_INVAL;
+		}
+	}
 	/*
 	 * With new state machine changes cds_close can be invoked without
 	 * cds_disable. So, send the following clean up prerequisites to fw,
@@ -1467,11 +1471,6 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc)
 	if (QDF_IS_STATUS_ERROR(qdf_status))
 		cds_err("Failed to close CDS Scheduler");
 
-	qdf_status = dispatcher_disable();
-	QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
-	if (QDF_IS_STATUS_ERROR(qdf_status))
-		cds_err("Failed to disable dispatcher; status:%d", qdf_status);
-
 	dispatcher_psoc_close(psoc);
 
 	qdf_flush_work(&gp_cds_context->cds_recovery_work);