From: York Sun Date: Fri, 15 Aug 2008 07:40:29 +0000 (-0700) Subject: freescale DIU: bug fix: add sanity check for AOI position X-Git-Tag: v2.6.27-rc4~87 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdfaa4833f984c6f8d44afb1fed6c0c775e6e67b;p=linux-2.6 freescale DIU: bug fix: add sanity check for AOI position AOI position cannot be negative. Signed-off-by: York Sun Cc: Kumar Gala Cc: "Antonino A. Daplas" Cc: Krzysztof Helt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index d9d24938da..fb51197d1c 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c @@ -479,6 +479,10 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var, base_plane_width = machine_data->fsl_diu_info[0]->var.xres; base_plane_height = machine_data->fsl_diu_info[0]->var.yres; + if (mfbi->x_aoi_d < 0) + mfbi->x_aoi_d = 0; + if (mfbi->y_aoi_d < 0) + mfbi->y_aoi_d = 0; switch (index) { case 0: if (mfbi->x_aoi_d != 0)