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

Commit 2d8a210f 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: check offset alignment in register debug functions"

parents 463bebbd c0121403
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2723,6 +2723,9 @@ static ssize_t sde_dbg_reg_base_offset_write(struct file *file,
	if (off > dbg->max_offset)
		return -EINVAL;

	if (off % sizeof(u32))
		return -EINVAL;

	if (cnt > (dbg->max_offset - off))
		cnt = dbg->max_offset - off;

@@ -2754,6 +2757,9 @@ static ssize_t sde_dbg_reg_base_offset_read(struct file *file,
	if (*ppos)
		return 0;	/* the end */

	if (dbg->off % sizeof(u32))
		return -EFAULT;

	len = snprintf(buf, sizeof(buf), "0x%08zx %zx\n", dbg->off, dbg->cnt);
	if (len < 0 || len >= sizeof(buf))
		return 0;
@@ -2797,6 +2803,9 @@ static ssize_t sde_dbg_reg_base_reg_write(struct file *file,
	if (cnt < 2)
		return -EFAULT;

	if (off % sizeof(u32))
		return -EFAULT;

	if (off >= dbg->max_offset)
		return -EFAULT;

@@ -2841,6 +2850,9 @@ static ssize_t sde_dbg_reg_base_reg_read(struct file *file,
		if (!dbg->buf)
			return -ENOMEM;

		if (dbg->off % sizeof(u32))
			return -EFAULT;

		ptr = dbg->base + dbg->off;
		tot = 0;