summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2014-04-03 15:46:59 +0800
committerSandor Yu <R01008@freescale.com>2014-04-03 15:58:29 +0800
commita7ff04798634d5323d865232b71cad6aa252cd1b (patch)
treeba7a412d4ed0c1c869a843c8c8506f378e72fc5f
parenta8a6771e74f06698fa0f8c5c06f23e5787f142a2 (diff)
ENGR00306832 mxsfb: xres_virtual should not larger than xres
eLCDIF did not support stride buffer, check the xres_virtual in function mxfb_check_var, return false if the value larger than xres. Signed-off-by: Sandor Yu <R01008@freescale.com>
-rw-r--r--drivers/video/mxsfb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 7b0304af8665..7636ea31737a 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -367,6 +367,11 @@ static int mxsfb_check_var(struct fb_var_screeninfo *var,
if (var->yres < MIN_YRES)
var->yres = MIN_YRES;
+ if (var->xres_virtual > var->xres) {
+ dev_dbg(fb_info->device, "stride not supported\n");
+ return -EINVAL;
+ }
+
if (var->xres_virtual < var->xres)
var->xres_virtual = var->xres;
if (var->yres_virtual < var->yres)