summaryrefslogtreecommitdiff
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorKarthikeyan Mani <kmani@codeaurora.org>2017-03-15 12:44:56 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-04-04 17:48:05 -0700
commit53572b845a42e562b39bbcaa9fb1faffcfeaccad (patch)
tree0c6f4112ea7682d4fe183190f8ab54d9737670da /sound/soc/codecs
parent4c332132fc72dd634004f76d92534995feaad15c (diff)
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: Karthikeyan Mani <kmani@codeaurora.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/wcd-mbhc-v2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c
index 7f9ad8ebcd3d..44141ae5668e 100644
--- a/sound/soc/codecs/wcd-mbhc-v2.c
+++ b/sound/soc/codecs/wcd-mbhc-v2.c
@@ -2217,7 +2217,7 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
INIT_WORK(&mbhc->correct_plug_swch, wcd_correct_swch_plug);
- init_completion(&mbhc->btn_press_compl);
+ reinit_completion(&mbhc->btn_press_compl);
WCD_MBHC_RSC_UNLOCK(mbhc);
pr_debug("%s: leave\n", __func__);
@@ -2854,6 +2854,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;