diff options
author | Tony Lin <tony.lin@freescale.com> | 2011-11-30 16:17:15 +0800 |
---|---|---|
committer | Eric Miao <eric.miao@linaro.org> | 2012-01-11 21:39:25 +0800 |
commit | ba1a90607765be2ff834e5fd5915f0f7db6be9e3 (patch) | |
tree | 5be77af724ea4986872af6a2cda73e5f4ea44833 | |
parent | 72efba263987891a9e252ac52f18c49a3adc715c (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>
-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 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; } |