xf86-video-intel: src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Apr 22 13:27:10 PDT 2014


 src/sna/sna_display.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit bb5b21e34f6cbe44a249e566471754b45c500e60
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Apr 22 21:22:37 2014 +0100

    sna: Apply defense against a rogue call to move a SW cursor
    
    So the sna_set_cursor_postion() assertion was reported to have caught us
    trying to adjust the position of an absent cursor. That should be
    impossible as we should only arrive there if we claim we can support a
    HW cursor and so have a registered cursor. However, changing the
    assertion into a guard is trivial, and preserves peace of mind.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index ab5b529..84d572e 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3460,8 +3460,10 @@ sna_set_cursor_position(ScrnInfoPtr scrn, int x, int y)
 	struct sna *sna = to_sna(scrn);
 	int sigio, c;
 
-	__DBG(("%s(%d, %d)\n", __FUNCTION__, x, y));
-	assert(sna->cursor.ref);
+	__DBG(("%s(%d, %d), cursor? %d\n", __FUNCTION__,
+	       x, y, sna->cursor.ref!=NULL));
+	if (sna->cursor.ref == NULL)
+		return;
 
 	sigio = sigio_block();
 	sna->cursor.last_x = x;
@@ -3685,9 +3687,6 @@ sna_cursors_init(ScreenPtr screen, struct sna *sna)
 static void
 sna_cursors_reload(struct sna *sna)
 {
-	if (sna->cursor.ref == NULL)
-		return;
-
 	sna_set_cursor_position(sna->scrn,
 				sna->cursor.last_x,
 				sna->cursor.last_y);


More information about the xorg-commit mailing list