[PATCH] ath12k: mhi: fix potential memory leak in ath12k_mhi_register()

Kalle Valo kvalo at kernel.org
Mon Oct 2 09:02:50 PDT 2023


Ma Ke <make_ruc2021 at 163.com> wrote:

> mhi_alloc_controller() allocates a memory space for mhi_ctrl. When some
> errors occur, mhi_ctrl should be freed by mhi_free_controller() and set
> ab_pci->mhi_ctrl = NULL.
> 
> We can fix it by calling mhi_free_controller() when the failure happens
> and set ab_pci->mhi_ctrl = NULL in all of the places where we call
> mhi_free_controller().
> 
> Signed-off-by: Ma Ke <make_ruc2021 at 163.com>
> Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

47c27aa7ded4 wifi: ath12k: mhi: fix potential memory leak in ath12k_mhi_register()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230922021036.3604157-1-make_ruc2021@163.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches




More information about the ath12k mailing list