Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e60b6e2f authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Linus Torvalds
Browse files

[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: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent fd5403c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;