avoid segfault in pci_device_vgaarb_fini() when called without

initializing the library first. (This happens when invalid options
are passed to X for instance). ok kettenis@
This commit is contained in:
matthieu 2010-07-26 18:48:48 +00:00
parent 9e6242225e
commit ae10e3711f

View File

@ -560,9 +560,12 @@ pci_device_vgaarb_init(void)
void
pci_device_vgaarb_fini(void)
{
struct pci_device *dev = pci_sys->vga_target;
struct pci_device *dev;
struct pci_vga pv;
if (pci_sys == NULL)
return;
dev = pci_sys->vga_target;
if (dev == NULL)
return;