From 1d325746a41744971e55ebf289ecf3b3bc19eaf5 Mon Sep 17 00:00:00 2001 From: Zhu Jianmin Date: Tue, 9 Jan 2018 12:49:35 +0800 Subject: [PATCH] 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 --- umac/tdls/core/src/wlan_tdls_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/umac/tdls/core/src/wlan_tdls_main.c b/umac/tdls/core/src/wlan_tdls_main.c index fc1817bcde97..7e447d3eba53 100644 --- a/umac/tdls/core/src/wlan_tdls_main.c +++ b/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;