Ver Fonte

qcacld-3.0: Move tdls_osif_init_cb after checking tdls_feature_flags

If tdls feature is disabled, as currently tdls_osif_init_cb is called
before checking flags, tdls_osif_deinit_cb will be missed which causes
memory leak.

Do tdls_osif_init_cb after checking tdls_feature_flags.

Change-Id: I008c69a9b39f5321d1ca79f5193539f5abd32a02
CRs-Fixed: 2459853
Jingxiang Ge há 5 anos atrás
pai
commit
37204fd470
1 ficheiros alterados com 6 adições e 5 exclusões
  1. 6 5
      components/tdls/core/src/wlan_tdls_main.c

+ 6 - 5
components/tdls/core/src/wlan_tdls_main.c

@@ -256,17 +256,18 @@ QDF_STATUS tdls_vdev_obj_create_notification(struct wlan_objmgr_vdev *vdev,
 		return QDF_STATUS_E_NOMEM;
 	}
 
-	if (tdls_soc_obj->tdls_osif_init_cb) {
-		status = tdls_soc_obj->tdls_osif_init_cb(vdev);
-		if (QDF_IS_STATUS_ERROR(status))
-			return status;
-	}
 	tdls_feature_flags = tdls_soc_obj->tdls_configs.tdls_feature_flags;
 	if (!TDLS_IS_ENABLED(tdls_feature_flags)) {
 		tdls_debug("disabled in ini");
 		return QDF_STATUS_E_NOSUPPORT;
 	}
 
+	if (tdls_soc_obj->tdls_osif_init_cb) {
+		status = tdls_soc_obj->tdls_osif_init_cb(vdev);
+		if (QDF_IS_STATUS_ERROR(status))
+			return status;
+	}
+
 	/* TODO: Add concurrency check */
 
 	tdls_vdev_obj = qdf_mem_malloc(sizeof(*tdls_vdev_obj));