All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] Wrong out of range check in drivers/char/applicom.c
@ 2006-04-09 17:06 Eric Sesterhenn
  0 siblings, 0 replies; only message in thread
From: Eric Sesterhenn @ 2006-04-09 17:06 UTC (permalink / raw)
  To: LKML; +Cc: dwmw2

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;



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-09 17:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-09 17:06 [Patch] Wrong out of range check in drivers/char/applicom.c Eric Sesterhenn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.