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

Commit b6b15c33 authored by Tatenda Chipeperekwa's avatar Tatenda Chipeperekwa
Browse files

msm: mdss: validate codec operations during HPD process



Validate the codec operations during the HPD process to ensure
that there is no potential null deference. The codec operations
can be invalid if there is no codec registered with the external
display module.

CRs-Fixed: 1009284
Change-Id: I4aa64724a912ae1df07d382d3eb346424b50cf36
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent 2e45ea72
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -360,10 +360,13 @@ static int msm_ext_disp_hpd(struct platform_device *pdev,
		ext_disp->current_disp = data->type;
	} else if ((state == EXT_DISPLAY_CABLE_DISCONNECT) &&
			!ext_disp->ack_enabled) {
		if (ext_disp->ops) {
			ext_disp->ops->audio_info_setup = NULL;
			ext_disp->ops->get_audio_edid_blk = NULL;
			ext_disp->ops->cable_status = NULL;
			ext_disp->ops->get_intf_id = NULL;
		}

		ext_disp->current_disp = EXT_DISPLAY_TYPE_MAX;
	}

@@ -451,7 +454,7 @@ static int msm_ext_disp_notify(struct platform_device *pdev,
	if (ret)
		goto end;

	if (new_state == EXT_DISPLAY_CABLE_CONNECT) {
	if (new_state == EXT_DISPLAY_CABLE_CONNECT && ext_disp->ops) {
		ext_disp->ops->audio_info_setup =
			data->codec_ops.audio_info_setup;
		ext_disp->ops->get_audio_edid_blk =
@@ -524,10 +527,13 @@ static int msm_ext_disp_audio_ack(struct platform_device *pdev, u32 ack)
	 * empty.
	 */
	if (!ack_hpd) {
		if (ext_disp->ops) {
			ext_disp->ops->audio_info_setup = NULL;
			ext_disp->ops->get_audio_edid_blk = NULL;
			ext_disp->ops->cable_status = NULL;
			ext_disp->ops->get_intf_id = NULL;
		}

		ext_disp->current_disp = EXT_DISPLAY_TYPE_MAX;
	}