diff mbox

[v2,08/29] fbdev: unicore32: use display information in info not in var for panning

Message ID 1308043507-11083-9-git-send-email-laurent.pinchart@ideasonboard.com (mailing list archive)
State Accepted
Commit aa7984cf51875bbb867485a72817bca5162fe80d
Headers show

Commit Message

Laurent Pinchart June 14, 2011, 9:24 a.m. UTC
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>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
---
 drivers/video/fb-puv3.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Guan Xuetao June 15, 2011, 2:40 a.m. UTC | #1
On Tue, 2011-06-14 at 11:24 +0200, Laurent Pinchart wrote:
> 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>
> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
> ---
>  drivers/video/fb-puv3.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c
> index 27f2c57..60a787f 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;
Tested-and-Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>

Thanks.
Guan Xuetao


--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c
index 27f2c57..60a787f 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;