diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-07-26 18:48:49 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-07-26 18:48:49 +0000 |
commit | 509f8fc3e3d6290013e6106c7ed66048c5e78d6e (patch) | |
tree | 4d98bb6176fe3ca5eac87abc1e8046248ebc75e1 | |
parent | c8f7a7db8f24093559f7d2ceb841c8823fd646ee (diff) |
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@
-rw-r--r-- | lib/libpciaccess/src/openbsd_pci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libpciaccess/src/openbsd_pci.c b/lib/libpciaccess/src/openbsd_pci.c index 48055fb0b..821e48f47 100644 --- a/lib/libpciaccess/src/openbsd_pci.c +++ b/lib/libpciaccess/src/openbsd_pci.c @@ -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; |