xf86-video-intel: 2 commits - src/sna/sna_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Aug 18 06:38:05 PDT 2014


 src/sna/sna_driver.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit f5469681b620d9d6ccaf53e92ed31f931cb03b0d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 18 14:37:44 2014 +0100

    sna: Be defensive during FreeScreen()
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 784ab60..4b35fe9 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -1188,7 +1188,7 @@ static void sna_free_screen(FREE_SCREEN_ARGS_DECL)
 	struct sna *sna = to_sna(scrn);
 
 	DBG(("%s [scrn=%p, sna=%p]\n", __FUNCTION__, scrn, sna));
-	if ((uintptr_t)sna & 3)
+	if (sna == NULL || (uintptr_t)sna & 3) /* beware thieves */
 		return;
 
 	scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2);
commit bfacb9d8dcd0fd590af3cb9fddc81904ef1e273b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Aug 18 14:37:19 2014 +0100

    sna: Add some DBG warnings for early PreInit failures
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index f903adf..784ab60 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -558,15 +558,19 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int probe)
 		return FALSE;
 
 	pEnt = xf86GetEntityInfo(scrn->entityList[0]);
-	if (pEnt == NULL)
+	if (pEnt == NULL) {
+		ERR(("%s: no EntityInfo found for scrn\n", __FUNCTION__));
 		return FALSE;
+	}
 
 	if (pEnt->location.type != BUS_PCI
 #ifdef XSERVER_PLATFORM_BUS
 	    && pEnt->location.type != BUS_PLATFORM
 #endif
-		)
+		) {
+		ERR(("%s: invalid EntityInfo found for scrn, location=%d\n", __FUNCTION__, pEnt->location.type));
 		return FALSE;
+	}
 
 	if (probe & PROBE_DETECT)
 		return TRUE;
@@ -1183,7 +1187,7 @@ static void sna_free_screen(FREE_SCREEN_ARGS_DECL)
 	SCRN_INFO_PTR(arg);
 	struct sna *sna = to_sna(scrn);
 
-	DBG(("%s\n", __FUNCTION__));
+	DBG(("%s [scrn=%p, sna=%p]\n", __FUNCTION__, scrn, sna));
 	if ((uintptr_t)sna & 3)
 		return;
 


More information about the xorg-commit mailing list