summaryrefslogtreecommitdiff
path: root/drivers/char/applicom.c
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-04-10 22:54:36 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 06:18:46 -0700
commite60b6e2f747e94358fed9a23afd6abd738de4bf7 (patch)
treebdfa71daf5ac502b9f21a54a71863fd2d364ce77 /drivers/char/applicom.c
parentfd5403c79bc21819f6e0c40ba098cea8b6a418bd (diff)
downloadlwn-e60b6e2f747e94358fed9a23afd6abd738de4bf7.tar.gz
lwn-e60b6e2f747e94358fed9a23afd6abd738de4bf7.zip
[PATCH] Wrong out of range check in drivers/char/applicom.c
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>
Diffstat (limited to 'drivers/char/applicom.c')
-rw-r--r--drivers/char/applicom.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 927a5bbe112c..a370e7a0bad5 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -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;