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

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

drm/msm/dp: add input validation for bpc function



Add input validation to ensure that there is a valid EDID
buffer before attempting to retrieve the panel bpc value.

CRs-Fixed: 2057884
Change-Id: I43a157265dba263908e75bc2b858f522f3302edd
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent b8cbd13f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ static u32 dp_panel_get_max_pclk(struct dp_panel *dp_panel)
{
	struct drm_dp_link *link_info;
	const u8 num_components = 3;
	u32 bpc, bpp, max_data_rate_khz, max_pclk_rate_khz;
	u32 bpc = 0, bpp = 0, max_data_rate_khz = 0, max_pclk_rate_khz = 0;

	if (!dp_panel) {
		pr_err("invalid input\n");
+5 −0
Original line number Diff line number Diff line
@@ -562,6 +562,11 @@ u32 sde_get_sink_bpc(void *input)
	struct sde_edid_ctrl *edid_ctrl = (struct sde_edid_ctrl *)(input);
	struct edid *edid = edid_ctrl->edid;

	if (!edid) {
		SDE_ERROR("invalid edid input\n");
		return 0;
	}

	if ((edid->revision < 3) || !(edid->input & DRM_EDID_INPUT_DIGITAL))
		return 0;