mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
HDMI: add mutex lock when hdmi is set to auto mode, to avoid
system crash by NULL pointer. Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
This commit is contained in:
@@ -210,7 +210,7 @@ static void hdmi_wq_insert(struct hdmi *hdmi)
|
||||
rockchip_hdmi_cec_set_pa(hdmi->edid.cecaddress);
|
||||
hdmi_send_uevent(hdmi, KOBJ_ADD);
|
||||
if (hdmi->enable) {
|
||||
hdmi->autoset = 0;
|
||||
/*hdmi->autoset = 0;*/
|
||||
hdmi_set_lcdc(hdmi);
|
||||
hdmi_wq_set_video(hdmi);
|
||||
#ifdef CONFIG_SWITCH
|
||||
|
||||
@@ -53,6 +53,7 @@ static int hdmi_set_mode(struct rk_display_device *device,
|
||||
container_of(mode, struct display_modelist, mode);
|
||||
int vic = 0;
|
||||
|
||||
mutex_lock(&hdmi->lock);
|
||||
if (mode == NULL) {
|
||||
hdmi->autoset = 1;
|
||||
vic = hdmi_find_best_mode(hdmi, 0);
|
||||
@@ -66,6 +67,7 @@ static int hdmi_set_mode(struct rk_display_device *device,
|
||||
if (hdmi->hotplug == HDMI_HPD_ACTIVED)
|
||||
hdmi_submit_work(hdmi, HDMI_SET_VIDEO, 0, NULL);
|
||||
}
|
||||
mutex_unlock(&hdmi->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user