diff options
author | Tony Lin <tony.lin@freescale.com> | 2011-11-30 16:17:15 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-01-09 21:08:41 +0800 |
commit | a08b3f30b3c23d6c9847bf545cd9b97f1564ce63 (patch) | |
tree | f3f33268054e8221801ec7e43c5666e1a4719fac /drivers/video | |
parent | 7534b585313b322eaa455e396a1571b89f422d48 (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')
-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; } |