From: Laurent Pinchart Date: Wed, 25 May 2011 09:34:52 +0000 (+0200) Subject: fbdev: unicore32: use display information in info not in var for panning X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=465cb7e700e8564fd2d76d5c7f3703eb07659617;p=~shefty%2Frdma-dev.git fbdev: unicore32: use display information in info not in var for panning We must not use any information in the passed var besides xoffset, yoffset and vmode as otherwise applications might abuse it. Signed-off-by: Laurent Pinchart Tested-by: Guan Xuetao Acked-by: Guan Xuetao --- diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c index 27f2c57e06e..60a787fa32c 100644 --- a/drivers/video/fb-puv3.c +++ b/drivers/video/fb-puv3.c @@ -624,8 +624,8 @@ static int unifb_pan_display(struct fb_var_screeninfo *var, || var->xoffset) return -EINVAL; } else { - if (var->xoffset + var->xres > info->var.xres_virtual || - var->yoffset + var->yres > info->var.yres_virtual) + if (var->xoffset + info->var.xres > info->var.xres_virtual || + var->yoffset + info->var.yres > info->var.yres_virtual) return -EINVAL; } info->var.xoffset = var->xoffset;