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

Commit c46a3228 authored by Karthikeyan Mani's avatar Karthikeyan Mani Committed by Banajit Goswami
Browse files

ASoC: codecs: Fix mbhc data NULL pointer dereferencing



Initialize completion structure in wcd_mbhc_initialize
and wcd_mbhc_init to handle irq handlers getting called
before the completion structure is initialized and ready
for use.

CRs-fixed: 2020227
Change-Id: Ibc7a5974adfe803c5b9892986165e2e1e3151fc7
Signed-off-by: default avatarKarthikeyan Mani <kmani@codeaurora.org>
parent b5c10cc9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1292,7 +1292,7 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
	wcd_program_btn_threshold(mbhc, false);


	init_completion(&mbhc->btn_press_compl);
	reinit_completion(&mbhc->btn_press_compl);

	WCD_MBHC_RSC_UNLOCK(mbhc);
	pr_debug("%s: leave\n", __func__);
@@ -1905,6 +1905,7 @@ int wcd_mbhc_init(struct wcd_mbhc *mbhc, struct snd_soc_codec *codec,
	}
	mutex_init(&mbhc->hphl_pa_lock);
	mutex_init(&mbhc->hphr_pa_lock);
	init_completion(&mbhc->btn_press_compl);

	/* Register event notifier */
	mbhc->nblock.notifier_call = wcd_event_notify;