mirror of
https://github.com/joel16/android_kernel_sony_msm8994.git
synced 2024-12-14 07:58:38 +00:00
[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>
This commit is contained in:
parent
fd5403c79b
commit
e60b6e2f74
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user