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

Commit c34a6ffd authored by Lloyd Atkinson's avatar Lloyd Atkinson
Browse files

drm/msm/dp: hold conn mode_config mutex to iterate over modes



Take the connector mode_config mutex when the DP driver iterates
over the connector's mode list in mode printing debug routine.

Change-Id: I9b8b143f8ba02a4f70c3e202ce6933a8eaf172b9
Signed-off-by: default avatarLloyd Atkinson <latkinso@codeaurora.org>
parent 07609e0f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -335,6 +335,7 @@ static ssize_t dp_debug_read_edid_modes(struct file *file,
		goto error;
	}

	mutex_lock(&connector->dev->mode_config.mutex);
	list_for_each_entry(mode, &connector->modes, head) {
		len += snprintf(buf + len, SZ_4K - len,
		"%s %d %d %d %d %d %d %d %d %d %d 0x%x\n",
@@ -343,6 +344,7 @@ static ssize_t dp_debug_read_edid_modes(struct file *file,
		mode->htotal, mode->vdisplay, mode->vsync_start,
		mode->vsync_end, mode->vtotal, mode->flags);
	}
	mutex_unlock(&connector->dev->mode_config.mutex);

	if (copy_to_user(user_buff, buf, len)) {
		kfree(buf);