summaryrefslogtreecommitdiff
path: root/hw/xfree86/common
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2018-10-26 17:47:30 -0700
committerAdam Jackson <ajax@nwnk.net>2018-10-29 15:51:44 +0000
commite50c85f4ebf559a3bac4817b41074c43d4691779 (patch)
treef4dd0ae454c1dbd49ea1676b7743bbc39462f40b /hw/xfree86/common
parent3297a1c871a25647d9d08b5f528e640cc2a1d2c2 (diff)
Fix segfault on probing a non-PCI platform device on a system with PCI.
Some Broadcom set-top-box boards have PCI busses, but the GPU is still probed through DT. We would dereference a null busid here in that case. Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r--hw/xfree86/common/xf86platformBus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index cef47da03..dadbac6c8 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -289,7 +289,7 @@ xf86platformProbe(void)
for (i = 0; i < xf86_num_platform_devices; i++) {
char *busid = xf86_platform_odev_attributes(i)->busid;
- if (pci && (strncmp(busid, "pci:", 4) == 0)) {
+ if (pci && busid && (strncmp(busid, "pci:", 4) == 0)) {
platform_find_pci_info(&xf86_platform_devices[i], busid);
}