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
This commit is contained in:
Zhu Jianmin
2018-01-09 12:49:35 +08:00
committed by snandini
parent 15ca1af93f
commit 1d325746a4

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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)) { if (QDF_IS_STATUS_ERROR(status)) {
tdls_err("Failed to attach psoc tdls component"); tdls_err("Failed to attach psoc tdls component");
qdf_mem_free(tdls_soc_obj); qdf_mem_free(tdls_soc_obj);
return status;
} }
tdls_soc_global = tdls_soc_obj; 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)) if (QDF_IS_STATUS_ERROR(status))
tdls_err("Failed to detach psoc tdls component"); tdls_err("Failed to detach psoc tdls component");
qdf_mem_free(tdls_soc_obj); qdf_mem_free(tdls_soc_obj);
return status; return status;