Commit 7572a1ea authored by Ville Syrjala's avatar Ville Syrjala Committed by Linus Torvalds

fbdev: xoffset, yoffset and yres are unsigned

The xoffset, yoffset and yres members of fb_var_screeninfo are __u32.
Make them unsigned in the code as well.
Signed-off-by: default avatarVille Syrjala <syrjala@sci.fi>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 43a3abc6
...@@ -848,9 +848,8 @@ int ...@@ -848,9 +848,8 @@ int
fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
{ {
struct fb_fix_screeninfo *fix = &info->fix; struct fb_fix_screeninfo *fix = &info->fix;
int xoffset = var->xoffset; unsigned int yres = info->var.yres;
int yoffset = var->yoffset; int err = 0;
int err = 0, yres = info->var.yres;
if (var->yoffset > 0) { if (var->yoffset > 0) {
if (var->vmode & FB_VMODE_YWRAP) { if (var->vmode & FB_VMODE_YWRAP) {
...@@ -866,8 +865,8 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) ...@@ -866,8 +865,8 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
(var->xoffset % fix->xpanstep))) (var->xoffset % fix->xpanstep)))
err = -EINVAL; err = -EINVAL;
if (err || !info->fbops->fb_pan_display || xoffset < 0 || if (err || !info->fbops->fb_pan_display ||
yoffset < 0 || var->yoffset + yres > info->var.yres_virtual || var->yoffset + yres > info->var.yres_virtual ||
var->xoffset + info->var.xres > info->var.xres_virtual) var->xoffset + info->var.xres > info->var.xres_virtual)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment