]> xenbits.xensource.com Git - seabios.git/commitdiff
Make sure to exit from cdrom_boot() if a cdrom is not found.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 9 Nov 2008 22:35:05 +0000 (17:35 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 9 Nov 2008 22:35:05 +0000 (17:35 -0500)
src/cdrom.c

index 0ccc2c43ffae063256b05d1e52a30f01cc55537f..3690f677e54058079e34cc7eefdcae64b827eea8 100644 (file)
@@ -432,6 +432,9 @@ cdrom_boot()
     for (device=0; device<CONFIG_MAX_ATA_DEVICES; device++)
         if (atapi_is_cdrom(device))
             break;
+    if (device >= CONFIG_MAX_ATA_DEVICES)
+        // cdrom not found
+        return 2;
 
     int ret = atapi_is_ready(device);
     if (ret)