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

Commit 255c4f67 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

platform: msm: check for codec ops



Check if the codec driver has registered with ext-display
module. If not, return early with error to avoid crash
where it may try to access codec driver's data.

CRs-Fixed: 2020938
Change-Id: I1bd7c9a8551bff32c4e5c2141e118dc097d906c4
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent 406fd057
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -218,6 +218,12 @@ static int msm_ext_disp_update_audio_ops(struct msm_ext_disp *ext_disp,
		goto end;
		goto end;
	}
	}


	if (!ext_disp->ops) {
		pr_err("codec ops not registered\n");
		ret = -EINVAL;
		goto end;
	}

	if (state == EXT_DISPLAY_CABLE_CONNECT) {
	if (state == EXT_DISPLAY_CABLE_CONNECT) {
		/* connect codec with interface */
		/* connect codec with interface */
		*ext_disp->ops = data->codec_ops;
		*ext_disp->ops = data->codec_ops;