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

Commit b1d5bcd2 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

msm: ext-disp: check for NULL before accessing codec ops



In case audio codec driver has failed to register with ext-disp
module, cable connect or disconnect request from DisplayPort driver
can still be processed to update the internal states. Check for
codec ops before accessing it during disconnect as it might be
NULL.

CRs-Fixed: 2128730
Change-Id: I917f0670228da1ebb3fc53064c4844c3f2a57d61
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent 4c4c2168
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -237,7 +237,10 @@ static int msm_ext_disp_update_audio_ops(struct msm_ext_disp *ext_disp,

		pr_debug("codec ops set for %s\n", msm_ext_disp_name(type));
	} else if (state == EXT_DISPLAY_CABLE_DISCONNECT) {
		*ext_disp->ops = (struct msm_ext_disp_audio_codec_ops){NULL};
		if (ext_disp->ops)
			*ext_disp->ops =
				(struct msm_ext_disp_audio_codec_ops){NULL};

		ext_disp->current_disp = EXT_DISPLAY_TYPE_MAX;

		pr_debug("codec ops cleared for %s\n", msm_ext_disp_name(type));