Messages in this thread Patch in this message | | | Subject | [Patch] Wrong out of range check in drivers/char/applicom.c | From | Eric Sesterhenn <> | Date | Sun, 09 Apr 2006 19:06:06 +0200 |
| |
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;
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |