Commit 9aad030d authored by Dmitry Baryshkov's avatar Dmitry Baryshkov
Browse files

drm/msm/dp: use eld_mutex to protect access to connector->eld



Reading access to connector->eld can happen at the same time the
drm_edid_to_eld() updates the data. Take the newly added eld_mutex in
order to protect connector->eld from concurrent access.

Reviewed-by: default avatarMaxime Ripard <mripard@kernel.org>
Acked-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241206-drm-connector-eld-mutex-v2-7-c9bce1ee8bea@linaro.org


Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent 5db44dd1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -414,8 +414,10 @@ static int msm_dp_audio_get_eld(struct device *dev,
		return -ENODEV;
	}

	mutex_lock(&msm_dp_display->connector->eld_mutex);
	memcpy(buf, msm_dp_display->connector->eld,
		min(sizeof(msm_dp_display->connector->eld), len));
	mutex_unlock(&msm_dp_display->connector->eld_mutex);

	return 0;
}