From ba1a90607765be2ff834e5fd5915f0f7db6be9e3 Mon Sep 17 00:00:00 2001 From: Tony Lin Date: Wed, 30 Nov 2011 16:17:15 +0800 Subject: ENGR00163616 [mx6q]hdmi will hang in daily build image make sure the pointer is valid before accessing Signed-off-by: Tony Lin --- drivers/video/mxc_hdmi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/video/mxc_hdmi.c b/drivers/video/mxc_hdmi.c index 924264c32e2..1fcd760103c 100644 --- a/drivers/video/mxc_hdmi.c +++ b/drivers/video/mxc_hdmi.c @@ -1359,9 +1359,10 @@ static int mxc_hdmi_cable_connected(struct mxc_hdmi *hdmi) fb_var_to_videomode(&m, &hdmi->fbi->var); mode = fb_find_nearest_mode(&m, &hdmi->fbi->modelist); + if (mode) + fb_videomode_to_var(&hdmi->fbi->var, mode); - fb_videomode_to_var(&hdmi->fbi->var, mode); - hdmi->need_mode_change = true; + hdmi->need_mode_change = mode ? true : false; } else { /* If not EDID data readed, setup default modelist */ dev_info(&hdmi->pdev->dev, "No modes read from edid\n"); @@ -1370,9 +1371,10 @@ static int mxc_hdmi_cable_connected(struct mxc_hdmi *hdmi) fb_var_to_videomode(&m, &hdmi->fbi->var); mode = fb_find_nearest_mode(&m, &hdmi->fbi->modelist); + if (mode) + fb_videomode_to_var(&hdmi->fbi->var, mode); - fb_videomode_to_var(&hdmi->fbi->var, mode); - hdmi->need_mode_change = true; + hdmi->need_mode_change = mode ? true : false; } -- cgit v1.2.3