From cdbe69a4ad316819f3bafd78cc126b9534f4d9a3 Mon Sep 17 00:00:00 2001 From: Ajit Pal Singh Date: Thu, 6 Jun 2019 11:24:23 +0530 Subject: [PATCH] qcacld-3.0: Incase of error return after ol_tx_download_done_base() In ol_tx_download_done_hl_free() when 'status != A_OK', tx_desc and netbuf are freed in ol_tx_download_done_base() irrespective of the reference count to tx_desc. Hence return after ol_tx_download_done_base() if 'status != A_OK'. Change-Id: I2e55d178abc0c2cf30d0f474962f4c06e5c8e327 CRs-Fixed: 2442568 --- core/dp/txrx/ol_tx_send.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/dp/txrx/ol_tx_send.c b/core/dp/txrx/ol_tx_send.c index 912e26377a88..9691df558ee7 100644 --- a/core/dp/txrx/ol_tx_send.c +++ b/core/dp/txrx/ol_tx_send.c @@ -330,6 +330,15 @@ ol_tx_download_done_hl_free(void *txrx_pdev, ol_tx_download_done_base(pdev, status, msdu, msdu_id); + /* + * Incase of error return from here since netbuf and tx_desc would + * have been freed in ol_tx_download_done_base(). + */ + if (status != A_OK) { + qdf_atomic_add(1, &pdev->tx_queue.rsrc_cnt); + return; + } + if ((tx_desc->pkt_type != OL_TX_FRM_NO_FREE) && (tx_desc->pkt_type < OL_TXRX_MGMT_TYPE_BASE)) { qdf_atomic_add(1, &pdev->tx_queue.rsrc_cnt);