Skip to content

Commit

Permalink
fbdev: xoffset, yoffset and yres are unsigned
Browse files Browse the repository at this point in the history
The xoffset, yoffset and yres members of fb_var_screeninfo are __u32.
Make them unsigned in the code as well.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ville Syrjala authored and Linus Torvalds committed Jul 24, 2008
1 parent 43a3abc commit 7572a1e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/video/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,8 @@ int
fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
{
struct fb_fix_screeninfo *fix = &info->fix;
int xoffset = var->xoffset;
int yoffset = var->yoffset;
int err = 0, yres = info->var.yres;
unsigned int yres = info->var.yres;
int err = 0;

if (var->yoffset > 0) {
if (var->vmode & FB_VMODE_YWRAP) {
Expand All @@ -866,8 +865,8 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
(var->xoffset % fix->xpanstep)))
err = -EINVAL;

if (err || !info->fbops->fb_pan_display || xoffset < 0 ||
yoffset < 0 || var->yoffset + yres > info->var.yres_virtual ||
if (err || !info->fbops->fb_pan_display ||
var->yoffset + yres > info->var.yres_virtual ||
var->xoffset + info->var.xres > info->var.xres_virtual)
return -EINVAL;

Expand Down

0 comments on commit 7572a1e

Please sign in to comment.