From: Eric Sesterhenn Date: Tue, 11 Apr 2006 05:54:37 +0000 (-0700) Subject: [PATCH] Overrun in cdrom/aztcd.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d93c2efc93f61c95808e303982f12fe6f5987270;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [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: Eric Sesterhenn Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c index ce4a1ce59d6..ec004897b63 100644 --- a/drivers/cdrom/aztcd.c +++ b/drivers/cdrom/aztcd.c @@ -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; }