From b71ad041682d8019df750fdb2ee6b2d51acc72c1 Mon Sep 17 00:00:00 2001 From: Karunakar Dasineni Date: Mon, 22 Jan 2018 16:50:20 -0800 Subject: [PATCH] qcacmn: Fix link descriptor pool cleanup Set link descriptor memory address to NULL after freeing to ensure it is not freed again. This is seen with soc_detach called during attach failures. Change-Id: I7338cb8c64fcb652c95f42bcb9e998a6f043cecf CRs-Fixed: 2160703 --- dp/wifi3.0/dp_main.c | 4 ++++ dp/wifi3.0/dp_rx_mon_dest.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 8e1a28828fe4..5e78d5efb60b 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -1353,6 +1353,7 @@ fail: soc->wbm_idle_scatter_buf_size, soc->wbm_idle_scatter_buf_base_vaddr[i], soc->wbm_idle_scatter_buf_base_paddr[i], 0); + soc->wbm_idle_scatter_buf_base_vaddr[i] = NULL; } } @@ -1363,6 +1364,7 @@ fail: soc->link_desc_banks[i].base_vaddr_unaligned, soc->link_desc_banks[i].base_paddr_unaligned, 0); + soc->link_desc_banks[i].base_vaddr_unaligned = NULL; } } return QDF_STATUS_E_FAILURE; @@ -1386,6 +1388,7 @@ static void dp_hw_link_desc_pool_cleanup(struct dp_soc *soc) soc->wbm_idle_scatter_buf_size, soc->wbm_idle_scatter_buf_base_vaddr[i], soc->wbm_idle_scatter_buf_base_paddr[i], 0); + soc->wbm_idle_scatter_buf_base_vaddr[i] = NULL; } } @@ -1396,6 +1399,7 @@ static void dp_hw_link_desc_pool_cleanup(struct dp_soc *soc) soc->link_desc_banks[i].base_vaddr_unaligned, soc->link_desc_banks[i].base_paddr_unaligned, 0); + soc->link_desc_banks[i].base_vaddr_unaligned = NULL; } } } diff --git a/dp/wifi3.0/dp_rx_mon_dest.c b/dp/wifi3.0/dp_rx_mon_dest.c index 01769933a77e..db541a0ba2a5 100644 --- a/dp/wifi3.0/dp_rx_mon_dest.c +++ b/dp/wifi3.0/dp_rx_mon_dest.c @@ -985,6 +985,7 @@ fail: dp_pdev->link_desc_banks[i].size, dp_pdev->link_desc_banks[i].base_vaddr_unaligned, dp_pdev->link_desc_banks[i].base_paddr_unaligned, 0); + dp_pdev->link_desc_banks[i].base_vaddr_unaligned = NULL; } } return QDF_STATUS_E_FAILURE; @@ -1004,6 +1005,7 @@ static void dp_mon_link_desc_pool_cleanup(struct dp_soc *soc, uint32_t mac_id) dp_pdev->link_desc_banks[i].size, dp_pdev->link_desc_banks[i].base_vaddr_unaligned, dp_pdev->link_desc_banks[i].base_paddr_unaligned, 0); + dp_pdev->link_desc_banks[i].base_vaddr_unaligned = NULL; } } }