vgabios: Check that the PCI BDF passed in is valid before using.
[seabios.git] / vgasrc / geodevga.c
index ce754a5b7886b23e18dd73e3135b7700804d37ed..5c6caf045397b307cb62aabe25ea8e5454d8b1c3 100644 (file)
@@ -363,6 +363,9 @@ int geodevga_init(void)
             stdvga_override_crtc(i, crtc);
     }
 
+    if (GET_GLOBAL(VgaBDF) < 0)
+        // Device should be at 00:01.1
+        SET_VGA(VgaBDF, pci_to_bdf(0, 1, 1));
     ret |= vp_setup();
     ret |= dc_setup();