Browse Source

qcacld-3.0: Use talloc, instead of malloc, in DSC

The lifetimes of DSC contexts do not fit nicely into the current domain
based dynamic memory leak detection scheme. Instead, allocate psoc and
vdev DSC contexts using the new qdf_talloc() API.

Change-Id: Ib15bd26004c3383e25039f4d17026d3e73f52346
CRs-Fixed: 2360348
Dustin Brown 6 years ago
parent
commit
77a042b426

+ 1 - 0
components/dsc/src/wlan_dsc_driver.c

@@ -17,6 +17,7 @@
  */
 
 #include "qdf_list.h"
+#include "qdf_mem.h"
 #include "qdf_status.h"
 #include "qdf_types.h"
 #include "__wlan_dsc.h"

+ 3 - 3
components/dsc/src/wlan_dsc_psoc.c

@@ -17,8 +17,8 @@
  */
 
 #include "qdf_list.h"
-#include "qdf_mem.h"
 #include "qdf_status.h"
+#include "qdf_talloc.h"
 #include "qdf_types.h"
 #include "__wlan_dsc.h"
 #include "wlan_dsc.h"
@@ -39,7 +39,7 @@ __dsc_psoc_create(struct dsc_driver *driver, struct dsc_psoc **out_psoc)
 
 	*out_psoc = NULL;
 
-	psoc = qdf_mem_malloc(sizeof(*psoc));
+	psoc = qdf_talloc_type(driver, psoc);
 	if (!psoc)
 		return QDF_STATUS_E_NOMEM;
 
@@ -102,7 +102,7 @@ static void __dsc_psoc_destroy(struct dsc_psoc **out_psoc)
 	qdf_list_destroy(&psoc->vdevs);
 	psoc->driver = NULL;
 
-	qdf_mem_free(psoc);
+	qdf_tfree(psoc);
 }
 
 void dsc_psoc_destroy(struct dsc_psoc **out_psoc)

+ 3 - 3
components/dsc/src/wlan_dsc_vdev.c

@@ -17,8 +17,8 @@
  */
 
 #include "qdf_list.h"
-#include "qdf_mem.h"
 #include "qdf_status.h"
+#include "qdf_talloc.h"
 #include "qdf_types.h"
 #include "__wlan_dsc.h"
 #include "wlan_dsc.h"
@@ -39,7 +39,7 @@ __dsc_vdev_create(struct dsc_psoc *psoc, struct dsc_vdev **out_vdev)
 
 	*out_vdev = NULL;
 
-	vdev = qdf_mem_malloc(sizeof(*vdev));
+	vdev = qdf_talloc_type(psoc, vdev);
 	if (!vdev)
 		return QDF_STATUS_E_NOMEM;
 
@@ -96,7 +96,7 @@ static void __dsc_vdev_destroy(struct dsc_vdev **out_vdev)
 	__dsc_trans_deinit(&vdev->trans);
 	vdev->psoc = NULL;
 
-	qdf_mem_free(vdev);
+	qdf_tfree(vdev);
 }
 
 void dsc_vdev_destroy(struct dsc_vdev **out_vdev)