From: Laurent Pinchart Date: Tue, 14 Jun 2011 09:24:46 +0000 (+0000) Subject: fbdev: unicore32: use display information in info not in var for panning X-Git-Tag: next-20110726~22^2~14^2~8 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=aa7984cf51875bbb867485a72817bca5162fe80d;p=karo-tx-linux.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 Cc: Guan Xuetao Signed-off-by: Paul Mundt --- diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c index 27f2c57e06e9..60a787fa32cf 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;