Browse Source

qcacmn: Avoid using tdls_soc_obj after it has been freed

Object tdls_soc_obj is being used ever after it has been freed
which creates stability issue.

Fix it by returning up on releasing the memory.

Change-Id: I0b3faf2435396f2e3cd92bc18afc263f3280eae3
CRs-Fixed: 2164332
Zhu Jianmin 7 years ago
parent
commit
1d325746a4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      umac/tdls/core/src/wlan_tdls_main.c

+ 2 - 2
umac/tdls/core/src/wlan_tdls_main.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -61,6 +61,7 @@ QDF_STATUS tdls_psoc_obj_create_notification(struct wlan_objmgr_psoc *psoc,
 	if (QDF_IS_STATUS_ERROR(status)) {
 		tdls_err("Failed to attach psoc tdls component");
 		qdf_mem_free(tdls_soc_obj);
+		return status;
 	}
 
 	tdls_soc_global = tdls_soc_obj;
@@ -88,7 +89,6 @@ QDF_STATUS tdls_psoc_obj_destroy_notification(struct wlan_objmgr_psoc *psoc,
 
 	if (QDF_IS_STATUS_ERROR(status))
 		tdls_err("Failed to detach psoc tdls component");
-
 	qdf_mem_free(tdls_soc_obj);
 
 	return status;