Skip to content

Commit

Permalink
[PATCH] Overrun in cdrom/aztcd.c
Browse files Browse the repository at this point in the history
This fixes coverity bug id #473.  After the for loop i==16 if we didn't find a
cdrom.  So we should check for i==16 first before checking the array element.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Cc: Jens Axboe <axboe@suse.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 e60b6e2 commit d93c2ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cdrom/aztcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,7 @@ static int __init aztcd_init(void)
release_region(azt_port, 4);
}
}
if ((azt_port_auto[i] == 0) || (i == 16)) {
if ((i == 16) || (azt_port_auto[i] == 0)) {
printk(KERN_INFO "aztcd: no AZTECH CD-ROM drive found\n");
return -EIO;
}
Expand Down

0 comments on commit d93c2ef

Please sign in to comment.