From 1c431c1103ce2beaa9e3658c2c5d03058f1c8279 Mon Sep 17 00:00:00 2001 From: Liu Ying <victor.liu@nxp.com> Date: Tue, 22 Aug 2017 15:54:57 +0800 Subject: [PATCH] MLK-16240 drm/bridge: it6263: Don't use freed edid structure in ->get_modes() We call the helper drm_detect_hdmi_monitor() to check if the EDID blob read from a monitor indicates the monitor is connected via HDMI or not. We pass an edid structure to the helper. However, the structure has been freed before we use it. This patch moves the helper up before the structure is freed to fix the issue. Fixes: a5c01aa91842 ("MLK-15001-25 drm/bridge: Add ITE IT6263 LVDS to HDMI transmitter support") Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit 3522359b02888370d910aa59646bac5824f7a0d3) --- drivers/gpu/drm/bridge/it6263.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/it6263.c b/drivers/gpu/drm/bridge/it6263.c index a651c104cb27d1..ac7174dc77d806 100644 --- a/drivers/gpu/drm/bridge/it6263.c +++ b/drivers/gpu/drm/bridge/it6263.c @@ -473,6 +473,7 @@ static int it6263_get_modes(struct drm_connector *connector) drm_connector_update_edid_property(connector, edid); if (edid) { num = drm_add_edid_modes(connector, edid); + it6263->is_hdmi = drm_detect_hdmi_monitor(edid); kfree(edid); } @@ -481,8 +482,6 @@ static int it6263_get_modes(struct drm_connector *connector) if (ret) return ret; - it6263->is_hdmi = drm_detect_hdmi_monitor(edid); - return num; } -- GitLab