Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

g364fb: 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 <laurent.pinchart@ideasonboard.com>

+3 -2
+3 -2
drivers/video/g364fb.c
··· 149 149 static int g364fb_pan_display(struct fb_var_screeninfo *var, 150 150 struct fb_info *info) 151 151 { 152 - if (var->xoffset || var->yoffset + var->yres > var->yres_virtual) 152 + if (var->xoffset || 153 + var->yoffset + info->var.yres > info->var.yres_virtual) 153 154 return -EINVAL; 154 155 155 - *(unsigned int *) TOP_REG = var->yoffset * var->xres; 156 + *(unsigned int *) TOP_REG = var->yoffset * info->var.xres; 156 157 return 0; 157 158 } 158 159