提交 d93c2efc 编写于 作者: E Eric Sesterhenn 提交者: Linus Torvalds

[PATCH] Overrun in cdrom/aztcd.c

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: NEric Sesterhenn <snakebyte@gmx.de>
Cc: Jens Axboe <axboe@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 e60b6e2f
...@@ -1763,7 +1763,7 @@ static int __init aztcd_init(void) ...@@ -1763,7 +1763,7 @@ static int __init aztcd_init(void)
release_region(azt_port, 4); 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"); printk(KERN_INFO "aztcd: no AZTECH CD-ROM drive found\n");
return -EIO; return -EIO;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册