Skip to content

Commit

Permalink
[PATCH] Wrong out of range check in drivers/char/applicom.c
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Eric Sesterhenn authored and Linus Torvalds committed Apr 11, 2006
1 parent fd5403c commit e60b6e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/applicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static int ac_register_board(unsigned long physloc, void __iomem *loc,
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;
Expand Down

0 comments on commit e60b6e2

Please sign in to comment.