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

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

Merge "msm: mdss: validate number of cea blocks before reading from edid_buf"

parents 79624670 accb48b3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -595,6 +595,11 @@ static ssize_t hdmi_tx_sysfs_rda_edid(struct device *dev,

	mutex_lock(&hdmi_ctrl->tx_lock);
	cea_blks = hdmi_ctrl->edid_buf[EDID_BLOCK_SIZE - 2];
	if (cea_blks >= MAX_EDID_BLOCKS) {
		DEV_ERR("%s: invalid cea blocks\n", __func__);
		mutex_unlock(&hdmi_ctrl->tx_lock);
		return -EINVAL;
	}
	size = (cea_blks + 1) * EDID_BLOCK_SIZE;
	size = min_t(u32, size, PAGE_SIZE);