Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6491d72c authored by Sujeev Dias's avatar Sujeev Dias
Browse files

mhi: core: Fix memory leak in MHI DE_INIT



During MHI INIT, memory is allocated for firmware and
rddm vector table. This memory is not freed when DE_INIT
is called.

CRs-Fixed: 2053206
Change-Id: I85b2644189915dd25d8ac31190f16799f86cbd12
Signed-off-by: default avatarSujeev Dias <sdias@codeaurora.org>
parent fb7523d0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -598,6 +598,7 @@ void bhi_exit(struct mhi_device_ctxt *mhi_dev_ctxt)
		dma_free_coherent(dev, bhie_mem_info->alloc_size,
				  bhie_mem_info->pre_aligned,
				  bhie_mem_info->dma_handle);
	kfree(fw_table->bhie_mem_info);
	fw_table->bhie_mem_info = NULL;
	/* vector table is the last entry in bhie_mem_info */
	fw_table->bhi_vec_entry = NULL;
@@ -613,6 +614,7 @@ void bhi_exit(struct mhi_device_ctxt *mhi_dev_ctxt)
		dma_free_coherent(dev, bhie_mem_info->alloc_size,
				  bhie_mem_info->pre_aligned,
				  bhie_mem_info->dma_handle);
	kfree(rddm_table->bhie_mem_info);
	rddm_table->bhie_mem_info = NULL;
	rddm_table->bhi_vec_entry = NULL;
}