diff options
-rw-r--r-- | drivers/video/fbmem.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 1cd5071e5362..6b487801eeae 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -848,9 +848,8 @@ int | |||
848 | fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) | 848 | fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) |
849 | { | 849 | { |
850 | struct fb_fix_screeninfo *fix = &info->fix; | 850 | struct fb_fix_screeninfo *fix = &info->fix; |
851 | int xoffset = var->xoffset; | 851 | unsigned int yres = info->var.yres; |
852 | int yoffset = var->yoffset; | 852 | int err = 0; |
853 | int err = 0, yres = info->var.yres; | ||
854 | 853 | ||
855 | if (var->yoffset > 0) { | 854 | if (var->yoffset > 0) { |
856 | if (var->vmode & FB_VMODE_YWRAP) { | 855 | if (var->vmode & FB_VMODE_YWRAP) { |
@@ -866,8 +865,8 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) | |||
866 | (var->xoffset % fix->xpanstep))) | 865 | (var->xoffset % fix->xpanstep))) |
867 | err = -EINVAL; | 866 | err = -EINVAL; |
868 | 867 | ||
869 | if (err || !info->fbops->fb_pan_display || xoffset < 0 || | 868 | if (err || !info->fbops->fb_pan_display || |
870 | yoffset < 0 || var->yoffset + yres > info->var.yres_virtual || | 869 | var->yoffset + yres > info->var.yres_virtual || |
871 | var->xoffset + info->var.xres > info->var.xres_virtual) | 870 | var->xoffset + info->var.xres > info->var.xres_virtual) |
872 | return -EINVAL; | 871 | return -EINVAL; |
873 | 872 | ||