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>
This commit is contained in:
Eric Anholt 2018-10-26 17:47:30 -07:00 committed by Adam Jackson
parent 3297a1c871
commit e50c85f4eb
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}