From a5fe863e3f1a6750edaffb518c4e768e9bc11521 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 25 May 2012 14:28:56 +0100 Subject: [PATCH] sna: Check the bus type before declaring probe success This should never fail, but still better to fail during detection rather than pretend it works. Signed-off-by: Chris Wilson --- src/sna/sna_driver.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 9c6994b2..0f43a467 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -402,6 +402,8 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags) return FALSE; pEnt = xf86GetEntityInfo(scrn->entityList[0]); + if (pEnt->location.type != BUS_PCI) + return FALSE; if (flags & PROBE_DETECT) return TRUE; @@ -419,9 +421,6 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags) scrn->displayWidth = 640; /* default it */ - if (sna->pEnt->location.type != BUS_PCI) - return FALSE; - sna->PciInfo = xf86GetPciInfoForEntity(sna->pEnt->index); fd = sna_open_drm_master(scrn);