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

Commit cc3f7b7e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm/sde: add out of bound check for vsync select"

parents 787dc14b 095c7135
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1586,6 +1586,15 @@ static void _sde_encoder_virt_enable_helper(struct drm_encoder *drm_enc)
				sde_enc->cur_master->hw_mdptop,
				sde_kms->catalog);

	if (sde_enc->num_phys_encs > ARRAY_SIZE(te_cfg.ppnumber) ||
			sde_enc->num_phys_encs > ARRAY_SIZE(sde_enc->hw_pp)) {
		SDE_ERROR("invalid num phys enc %d/%d/%d\n",
				sde_enc->num_phys_encs,
				(int) ARRAY_SIZE(te_cfg.ppnumber),
				(int) ARRAY_SIZE(sde_enc->hw_pp));
		return;
	}

	if (hw_mdptop->ops.setup_vsync_sel) {
		for (i = 0; i < sde_enc->num_phys_encs; i++)
			te_cfg.ppnumber[i] = sde_enc->hw_pp[i]->idx;
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ static void sde_hw_setup_vsync_sel(struct sde_hw_mdp *mdp,
	int i = 0;
	u32 pp_offset[] = {0xC, 0x8, 0x4, 0x13};

	if (!mdp)
	if (!mdp || !cfg || (cfg->pp_count > ARRAY_SIZE(cfg->ppnumber)))
		return;

	reg = SDE_REG_READ(c, MDP_VSYNC_SEL);