linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	linux-fbdev-devel@lists.sourceforge.net,
	Antonino Daplas <adaplas@gmail.com>
Subject: [PATCH] fbdev: Fix test on unsigned in fb_do_show_logo()
Date: Sat, 17 Oct 2009 00:45:14 +0200	[thread overview]
Message-ID: <4AD8F77A.3010802@gmail.com> (raw)

image->d[xy] are unsigned so the check was wrong.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 99bbd28..9f20641 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -403,7 +403,8 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
 			image->dx += image->width + 8;
 		}
 	} else if (rotate == FB_ROTATE_UD) {
-		for (x = 0; x < num && image->dx >= 0; x++) {
+		for (x = 0; x < num && image->dx + image->width + 8 >= 0;
+				x++) {
 			info->fbops->fb_imageblit(info, image);
 			image->dx -= image->width + 8;
 		}
@@ -415,7 +416,8 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
 			image->dy += image->height + 8;
 		}
 	} else if (rotate == FB_ROTATE_CCW) {
-		for (x = 0; x < num && image->dy >= 0; x++) {
+		for (x = 0; x < num && image->dy + image->height + 8 >= 0;
+				x++) {
 			info->fbops->fb_imageblit(info, image);
 			image->dy -= image->height + 8;
 		}

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

             reply	other threads:[~2009-10-16 22:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-16 22:45 Roel Kluin [this message]
2009-11-03  0:32 ` [PATCH] fbdev: Fix test on unsigned in fb_do_show_logo() Andrew Morton

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=4AD8F77A.3010802@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=adaplas@gmail.com \
    --cc=akpm@linux-foundation.org \
    --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).