vgaarb: check pci_sys exists before initing vga arb
authorDave Airlie <airlied@linux.ie>
Wed, 2 Sep 2009 09:03:11 +0000 (19:03 +1000)
committerDave Airlie <airlied@linux.ie>
Wed, 2 Sep 2009 09:03:11 +0000 (19:03 +1000)
src/common_vgaarb.c

index a40b064..ca5c0a7 100644 (file)
@@ -124,6 +124,10 @@ pci_device_vgaarb_init(void)
     struct pci_slot_match match;
     char buf[BUFSIZE];
     int ret, rsrc;
+
+    if (!pci_sys)
+        return -1;
+
     if ((pci_sys->vgaarb_fd = open ("/dev/vga_arbiter", O_RDWR)) < 0) {
         return errno;
     }