Skip to contentSkip to conversation

Overrun in cdrom/aztcd.c

PATCH New Eric Sesterhenn 1 participant 1 message Apr 9, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Overrun in cdrom/aztcd.c

hi,

this fixes coverity bug id #473.
After the for loop i==16 if we dont find a cdrom. So we should check for i==16 first before checking the array element.

drivers/cdrom/aztcd.c renamed from drivers/cdrom/aztcd.c.orig +1 -1
@@ -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;
 		}