blob: 7b9e3b4cad54a88e4ebc5c26bd81739de6ad65f0 [file] [log] [blame]
Andrew Geisslerc9f78652020-09-18 14:11:35 -05001From e50c85f4ebf559a3bac4817b41074c43d4691779 Mon Sep 17 00:00:00 2001
2From: Eric Anholt <eric@anholt.net>
3Date: Fri, 26 Oct 2018 17:47:30 -0700
4Subject: [PATCH] Fix segfault on probing a non-PCI platform device on a system
5 with PCI.
6
7Some Broadcom set-top-box boards have PCI busses, but the GPU is still
8probed through DT. We would dereference a null busid here in that
9case.
10
11Signed-off-by: Eric Anholt <eric@anholt.net>
12
13Upstream-status: Backport [https://github.com/freedesktop/xorg-xserver/commit/e50c85f4e]
14Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
15---
16 hw/xfree86/common/xf86platformBus.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
20index cef47da03..dadbac6c8 100644
21--- a/hw/xfree86/common/xf86platformBus.c
22+++ b/hw/xfree86/common/xf86platformBus.c
23@@ -289,7 +289,7 @@ xf86platformProbe(void)
24 for (i = 0; i < xf86_num_platform_devices; i++) {
25 char *busid = xf86_platform_odev_attributes(i)->busid;
26
27- if (pci && (strncmp(busid, "pci:", 4) == 0)) {
28+ if (pci && busid && (strncmp(busid, "pci:", 4) == 0)) {
29 platform_find_pci_info(&xf86_platform_devices[i], busid);
30 }
31
32--
332.28.0
34