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

Commit cd51c0ed authored by Laxminath Kasam's avatar Laxminath Kasam
Browse files

ASoC: msm: Fix memleak in machine probe



In machine probe, incase of probe deferral
unmap for a ioremap address is missing.
This can result in memleak. Address it by
calling unmap whenever returning with
failure from probe function.

CRs-Fixed: 974426
Change-Id: I1d18ecff5f2a9ee6c66d1ae26071d438c887151b
Signed-off-by: default avatarLaxminath Kasam <lkasam@codeaurora.org>
parent 676c9bc2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2452,6 +2452,8 @@ err:
		iounmap(pdata->vaddr_gpio_mux_spkr_ctl);
	if (pdata->vaddr_gpio_mux_mic_ctl)
		iounmap(pdata->vaddr_gpio_mux_mic_ctl);
	if (pdata->vaddr_gpio_mux_pcm_ctl)
		iounmap(pdata->vaddr_gpio_mux_pcm_ctl);
	if (pdata->vaddr_gpio_mux_quin_ctl)
		iounmap(pdata->vaddr_gpio_mux_quin_ctl);
	cancel_delayed_work_sync(&pdata->hs_detect_dwork);
@@ -2474,6 +2476,8 @@ static int msm8952_asoc_machine_remove(struct platform_device *pdev)
		iounmap(pdata->vaddr_gpio_mux_spkr_ctl);
	if (pdata->vaddr_gpio_mux_mic_ctl)
		iounmap(pdata->vaddr_gpio_mux_mic_ctl);
	if (pdata->vaddr_gpio_mux_pcm_ctl)
		iounmap(pdata->vaddr_gpio_mux_pcm_ctl);
	if (pdata->vaddr_gpio_mux_quin_ctl)
		iounmap(pdata->vaddr_gpio_mux_quin_ctl);