diff options
author | Tony Lin <tony.lin@freescale.com> | 2011-11-30 16:17:15 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-07-20 13:18:23 +0800 |
commit | 5e090fc9af4445b85b15094b2f046f2746f5c1c2 (patch) | |
tree | 14f17f667451020c474fa6f59c6b1364e6d57a5b /drivers/video/mxc_hdmi.c | |
parent | 600639ddbac4a120ca10e56ff15c42ed8082d7ce (diff) |
ENGR00163616 [mx6q]hdmi will hang in daily build image
make sure the pointer is valid before accessing
Signed-off-by: Tony Lin <tony.lin@freescale.com>
Diffstat (limited to 'drivers/video/mxc_hdmi.c')
-rw-r--r-- | drivers/video/mxc_hdmi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/video/mxc_hdmi.c b/drivers/video/mxc_hdmi.c index 0298c243b1a9..09930158fb0e 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; } |