The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: geert@linux-m68k.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH-2.4] fbcon: incorrect use of "&&" instead of "&"
Date: Sat, 25 Nov 2006 22:22:09 +0100	[thread overview]
Message-ID: <20061125212209.GA5918@1wt.eu> (raw)

Hi Geert,

I'm about to merge this in 2.4. Do you have any objection ?

Thanks,
Willy

>From c969fc8009aeb748368319cec463ae2516f6fb17 Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Sat, 25 Nov 2006 21:54:10 +0100
Subject: [PATCH] fbcon: incorrect use of "&&" instead of "&"

The use of "&&" in the following statement causes unexpected
cases to be matched since __SCROLL_YMASK = 0x0f :

    switch (p->scrollmode && __SCROLL_YMASK)
        case __SCROLL_YWRAP: ...  /* 0x02 */
        case __SCROLL_YPAN: ...   /* 0x01 */

The YWRAP case can never be matched and the YPAN case may be
matched by mistake. Obvious fix is to replace && with &. This
bug is not present in 2.6.

Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 drivers/video/fbcon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/fbcon.c b/drivers/video/fbcon.c
index 0fb40c5..1f66819 100644
--- a/drivers/video/fbcon.c
+++ b/drivers/video/fbcon.c
@@ -2102,7 +2102,7 @@ static int fbcon_scrolldelta(struct vc_d
 
     offset = p->yscroll-scrollback_current;
     limit = p->vrows;
-    switch (p->scrollmode && __SCROLL_YMASK) {
+    switch (p->scrollmode & __SCROLL_YMASK) {
 	case __SCROLL_YWRAP:
 	    p->var.vmode |= FB_VMODE_YWRAP;
 	    break;
-- 
1.4.2.4


             reply	other threads:[~2006-11-25 20:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-25 21:22 Willy Tarreau [this message]
2006-11-26  8:33 ` [PATCH-2.4] fbcon: incorrect use of "&&" instead of "&" Geert Uytterhoeven
2006-11-26  8:49   ` Willy Tarreau

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=20061125212209.GA5918@1wt.eu \
    --to=w@1wt.eu \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    /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