From: Kai Jiang <b18973@freescale.com>
To: linux-fbdev-devel@lists.sourceforge.net
Subject: [linux-fbdev-devel][PATCH]fb_pan_display:add x/yoffset check
Date: Mon, 29 Jun 2009 11:49:31 +0800 [thread overview]
Message-ID: <4A4839CB.8020801@freescale.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: fb_pan_display-check-offset.patch --]
[-- Type: text/x-patch, Size: 1811 bytes --]
From a01ede69772634b30a83b44eada5a8db66f8463a Mon Sep 17 00:00:00 2001
From: Kai Jiang <Kai.Jiang@freescale.com>
Date: Mon, 29 Jun 2009 11:25:58 +0800
Subject: [PATCH] When moving virtual space straight to one side in the screen(ex.
straight to the left),finally the virtual space will move outside
of the real screen. Then the xoffset or yoffset will be nagative
value(transfered from user application) to indicate that the virtual
space is beyond the screen boundary. In the function fb_pan_disaplay,
xoffset and yoffset should be checked to ensure that, when they are
negative, the virtual space will not move any more,and the function
will return an error. However, xoffset and yoffset in the structure
fb_var_screeninfo are "__u32" type, here need to transfer them to
"int" type for comparing.
Signed-off-by: Kai Jiang <Kai.Jiang@freescale.com>
---
drivers/video/fbmem.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index d412a1d..27628de 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -855,6 +855,8 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
{
struct fb_fix_screeninfo *fix = &info->fix;
unsigned int yres = info->var.yres;
+ int xoffset = var->xoffset;
+ int yoffset = var->yoffset;
int err = 0;
if (var->yoffset > 0) {
@@ -873,7 +875,8 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
if (err || !info->fbops->fb_pan_display ||
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 ||
+ xoffset < 0 || yoffset < 0)
return -EINVAL;
if ((err = info->fbops->fb_pan_display(var, info)))
--
1.6.2.1
[-- Attachment #3: Type: text/plain, Size: 79 bytes --]
------------------------------------------------------------------------------
[-- Attachment #4: Type: text/plain, Size: 182 bytes --]
_______________________________________________
Linux-fbdev-devel mailing list
Linux-fbdev-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
next reply other threads:[~2009-06-29 3:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-29 3:49 Kai Jiang [this message]
2009-06-29 10:39 ` [linux-fbdev-devel][PATCH]fb_pan_display:add x/yoffset check Ville Syrjälä
2009-06-30 3:25 ` Kai Jiang
2009-07-03 15:30 ` Ville Syrjälä
2009-07-03 16:11 ` Florian Tobias Schandinat
2009-07-06 3:00 ` Kai Jiang
2009-07-06 14:12 ` Florian Tobias Schandinat
2009-07-07 2:43 ` Kai Jiang
2009-07-07 4:01 ` Florian Tobias Schandinat
2009-07-10 8:22 ` Kai Jiang
2009-08-03 18:58 ` [PATCH] fb: fix fb_pan_display range check Florian Tobias Schandinat
2009-07-06 2:54 ` [linux-fbdev-devel][PATCH]fb_pan_display:add x/yoffset check Kai Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A4839CB.8020801@freescale.com \
--to=b18973@freescale.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).