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

Commit 6b375e85 authored by dojha's avatar dojha Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd-mbhc: add null pointer check



Crash observed during headset detection because of a null pointer
access. So check for pointer not being null prior access.

CRs-Fixed: 1010966
Change-Id: I097c077317a3082121dc9b0f553b9538b5fb75ae
Signed-off-by: default avatardojha <dojha@codeaurora.org>
parent e5627c64
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1206,7 +1206,8 @@ correct_plug_type:
					mbhc->hs_detect_work_stop);
			wcd_enable_curr_micbias(mbhc,
						WCD_MBHC_EN_NONE);
			if (mbhc->micbias_enable) {
			if (mbhc->mbhc_cb->mbhc_micb_ctrl_thr_mic &&
				mbhc->micbias_enable) {
				mbhc->mbhc_cb->mbhc_micb_ctrl_thr_mic(
					mbhc->codec, MIC_BIAS_2, false);
				if (mbhc->mbhc_cb->set_micbias_value)
@@ -1231,7 +1232,8 @@ correct_plug_type:
					mbhc->hs_detect_work_stop);
			wcd_enable_curr_micbias(mbhc,
						WCD_MBHC_EN_NONE);
			if (mbhc->micbias_enable) {
			if (mbhc->mbhc_cb->mbhc_micb_ctrl_thr_mic &&
				mbhc->micbias_enable) {
				mbhc->mbhc_cb->mbhc_micb_ctrl_thr_mic(
					mbhc->codec, MIC_BIAS_2, false);
				if (mbhc->mbhc_cb->set_micbias_value)