mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Sesterhenn <snakebyte@gmx.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: dwmw2@infradead.org
Subject: [Patch] Wrong out of range check in drivers/char/applicom.c
Date: Sun, 09 Apr 2006 19:06:06 +0200	[thread overview]
Message-ID: <1144602367.19348.3.camel@alice> (raw)

hi,

this fixes coverity bug id #469. The out of range check didnt
work as intended, as seen by the printk(), which states that 
boardno has to be 1 <= boardno <= MAX_BOARD.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.17-rc1/drivers/char/applicom.c.orig	2006-04-09 18:57:29.000000000 +0200
+++ linux-2.6.17-rc1/drivers/char/applicom.c	2006-04-09 18:57:55.000000000 +0200
@@ -142,7 +142,7 @@ static int ac_register_board(unsigned lo
 	if (!boardno)
 		boardno = readb(loc + NUMCARD_OWNER_TO_PC);
 
-	if (!boardno && boardno > MAX_BOARD) {
+	if (!boardno || boardno > MAX_BOARD) {
 		printk(KERN_WARNING "Board #%d (at 0x%lx) is out of range (1 <= x <= %d).\n",
 		       boardno, physloc, MAX_BOARD);
 		return 0;



                 reply	other threads:[~2006-04-09 17:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1144602367.19348.3.camel@alice \
    --to=snakebyte@gmx.de \
    --cc=dwmw2@infradead.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

Powered by JetHome