diff options
| author | Arunk Khandavalli <akhandav@codeaurora.org> | 2017-04-03 21:40:26 +0530 |
|---|---|---|
| committer | Sandeep Puligilla <spuligil@codeaurora.org> | 2017-04-07 07:48:07 -0700 |
| commit | c8a684a3197af39d922b166310921eca47d5600a (patch) | |
| tree | 1dfe0da92248293c92c21ea5f01e52a63edb81c8 | |
| parent | b71aa6877d97af6864366ec793c3fd45045a66be (diff) | |
qcacmn: Fix Dma memory allocation leak from Hif layer
HIF close is not freeing RRI memory allocated during HIF initialization
resulting in memory leak of RRI memory after driver unload
To mitigate the issue, freeing RRI memory in HIF close.
Change-Id: Ib3daba8de0cabc1d8e303d7148448d21c47905e7
CRs-Fixed: 2019147
| -rw-r--r-- | hif/src/ce/ce_main.c | 1 | ||||
| -rw-r--r-- | hif/src/hif_main.c | 7 | ||||
| -rw-r--r-- | hif/src/hif_main.h | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 2cd0ec6a0bed..2ea2280af24d 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -2860,6 +2860,7 @@ static inline void hif_config_rri_on_ddr(struct hif_softc *scn) scn->qdf_dev->dev, (CE_COUNT*sizeof(uint32_t)), &paddr_rri_on_ddr); + scn->paddr_rri_on_ddr = paddr_rri_on_ddr; low_paddr = BITS0_TO_31(paddr_rri_on_ddr); high_paddr = BITS32_TO_35(paddr_rri_on_ddr); diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index fa678cf0a5e4..60159c890c5a 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -447,6 +447,13 @@ void hif_close(struct hif_opaque_softc *hif_ctx) qdf_mem_free(hw_name); } + if (scn->vaddr_rri_on_ddr) + qdf_mem_free_consistent(scn->qdf_dev, scn->qdf_dev->dev, + (CE_COUNT*sizeof(uint32_t)), + scn->vaddr_rri_on_ddr, scn->paddr_rri_on_ddr, + 0); + + scn->vaddr_rri_on_ddr = NULL; hif_bus_close(scn); qdf_mem_free(scn); } diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h index aac91095b7d3..aa5cdaad8e98 100644 --- a/hif/src/hif_main.h +++ b/hif/src/hif_main.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -147,6 +147,7 @@ struct hif_softc { atomic_t active_tasklet_cnt; atomic_t link_suspended; uint32_t *vaddr_rri_on_ddr; + qdf_dma_addr_t paddr_rri_on_ddr; int linkstate_vote; bool fastpath_mode_on; atomic_t tasklet_from_intr; |
