[PATCH] EXA: Only return TRUE from ExaDoPrepareAccess if the driver hook succeeded.

Michel Dänzer michel at daenzer.net
Tue Dec 8 09:12:50 PST 2009


From: Michel Dänzer <daenzer at vmware.com>

This is what's documented in the function header and expected by both callers
which care about the return code. In particular, otherwise
exaPrepareAccessReg_mixed may incorrectly free the system memory copy, e.g.
when the same pixmap is both the destination and source of an operation.

(The other place which cares is exaAssertNotDirty(), which is a classic
specific debugging function not active normally)

Signed-off-by: Michel Dänzer <daenzer at vmware.com>
---
 exa/exa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/exa/exa.c b/exa/exa.c
index 23a1388..c5c67fc 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -304,7 +304,7 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
     for (i = 0; i < EXA_NUM_PREPARE_INDICES; i++) {
 	if (pExaScr->access[i].pixmap == pPixmap) {
 	    pExaScr->access[i].count++;
-	    return TRUE;
+	    return FALSE;
 	}
     }
 
@@ -338,7 +338,7 @@ ExaDoPrepareAccess(PixmapPtr pPixmap, int index)
     exaWaitSync (pScreen);
 
     if (pExaScr->info->PrepareAccess == NULL)
-	return TRUE;
+	return FALSE;
 
     if (index >= EXA_PREPARE_AUX_DEST &&
 	!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
-- 
1.6.4.3



More information about the xorg-devel mailing list