From 90c6846477b6de7c5b96e9e64d9b328dd1a378c3 Mon Sep 17 00:00:00 2001 From: chenguo Date: Thu, 24 Jan 2019 18:27:01 +0800 Subject: [PATCH] qcacld-3.0: Set nbuf to NULL in error handling of wma_tx_packet The caller of wma_tx_packet does not need to check if nbuf becomes to NULL to decide if the nbuf free is needed. It is the designing job of wma_tx_packet to free it if there is something wrong. Fix one of the double free issue in ADDBA response transmission. CRs-Fixed: 2379912 Change-Id: I944dea72a72cf9d937a72a3e0a31bbad88c8694d --- core/mac/src/pe/lim/lim_send_management_frames.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index 700c452525..c62fef1fb4 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -4728,14 +4728,7 @@ QDF_STATUS lim_send_addba_response_frame(struct mac_context *mac_ctx, if (QDF_STATUS_SUCCESS != qdf_status) { pe_err("wma_tx_frame FAILED! Status [%d]", qdf_status); - qdf_status = QDF_STATUS_E_FAILURE; - /* - * wma_tx_frame free memory in certain cases, free pkt_ptr - * only if not freed already. - */ - if (pkt_ptr) - cds_packet_free((void *)pkt_ptr); - return qdf_status; + return QDF_STATUS_E_FAILURE; } else { return QDF_STATUS_SUCCESS; }