0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch 1.2 KB

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