From a7ff04798634d5323d865232b71cad6aa252cd1b Mon Sep 17 00:00:00 2001 From: Sandor Yu Date: Thu, 3 Apr 2014 15:46:59 +0800 Subject: [PATCH] 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 --- drivers/video/mxsfb.c | 5 +++++ 1 file changed, 5 insertions(+) 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) -- 2.39.2