From 4a7037e0f888dd55435ced07d424ca191f42e84c Mon Sep 17 00:00:00 2001 From: Laxminath Kasam Date: Mon, 21 Dec 2015 16:11:58 +0530 Subject: [PATCH] ASoC: wcd-mbhc: initialize boolean flag anc_mic_found As anc_mic_found is not initialized, it is taking input as true and report as ANC Headphone results in wrong accessory detection. Initialize the flag to false that fixes the issue. Change-Id: I1c9912e2ab396a8a0a31065b826d6f92a0603215 Signed-off-by: Laxminath Kasam --- sound/soc/codecs/wcd-mbhc-v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c index ade9c704ea48..96267ffa99ec 100644 --- a/sound/soc/codecs/wcd-mbhc-v2.c +++ b/sound/soc/codecs/wcd-mbhc-v2.c @@ -784,7 +784,7 @@ exit: static void wcd_mbhc_find_plug_and_report(struct wcd_mbhc *mbhc, enum wcd_mbhc_plug_type plug_type) { - bool anc_mic_found; + bool anc_mic_found = false; enum snd_jack_types jack_type; pr_debug("%s: enter current_plug(%d) new_plug(%d)\n", -- 2.11.0