mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
qcacmn: Fix memleak during wifi unload
The soc common cleanup should be called from pdev_deinit path to prevent leak of m/r allocated for spinlocks and Tx descriptors. Change-Id: Ie8ad3d164ab07f37f8143d1fe147e5cbabbb4991
This commit is contained in:
parent
942a552a17
commit
8e068f4023
1 changed files with 7 additions and 7 deletions
|
|
@ -3014,8 +3014,6 @@ fail1:
|
|||
*/
|
||||
static void dp_soc_cmn_cleanup(struct dp_soc *soc)
|
||||
{
|
||||
dp_tx_soc_detach(soc);
|
||||
|
||||
qdf_spinlock_destroy(&soc->rx.defrag.defrag_lock);
|
||||
|
||||
dp_reo_cmdlist_destroy(soc);
|
||||
|
|
@ -3870,6 +3868,11 @@ static void dp_pdev_deinit(struct cdp_pdev *txrx_pdev, int force)
|
|||
dp_cal_client_detach(&pdev->cal_client_ctx);
|
||||
|
||||
soc->pdev_count--;
|
||||
|
||||
/* only do soc common cleanup when last pdev do detach */
|
||||
if (!(soc->pdev_count))
|
||||
dp_soc_cmn_cleanup(soc);
|
||||
|
||||
wlan_cfg_pdev_detach(pdev->wlan_cfg_ctx);
|
||||
if (pdev->invalid_peer)
|
||||
qdf_mem_free(pdev->invalid_peer);
|
||||
|
|
@ -3971,11 +3974,6 @@ static void dp_pdev_detach_wifi3(struct cdp_pdev *txrx_pdev, int force)
|
|||
dp_pdev_deinit(txrx_pdev, force);
|
||||
dp_pdev_detach(txrx_pdev, force);
|
||||
}
|
||||
|
||||
/* only do soc common cleanup when last pdev do detach */
|
||||
if (!(soc->pdev_count))
|
||||
dp_soc_cmn_cleanup(soc);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -4152,6 +4150,8 @@ static void dp_soc_detach(void *txrx_soc)
|
|||
/* Common rings */
|
||||
dp_srng_cleanup(soc, &soc->wbm_desc_rel_ring, SW2WBM_RELEASE, 0);
|
||||
|
||||
dp_tx_soc_detach(soc);
|
||||
|
||||
/* Tx data rings */
|
||||
if (!wlan_cfg_per_pdev_tx_ring(soc->wlan_cfg_ctx)) {
|
||||
for (i = 0; i < soc->num_tcl_data_rings; i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue