[Intel-gfx] [PATCH 5/7] sna/cursor: add an assert on cursor->image

Martin Peres martin.peres at linux.intel.com
Fri Feb 12 16:31:27 UTC 2016


Caught by Klockwork, but it was a false positive. However, better safe
than sorry.

Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
---
 src/sna/sna_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 9215b23..78937c2 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5573,8 +5573,9 @@ static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc)
 	argb = get_cursor_argb(sna->cursor.ref);
 	pitch = BitmapBytePad(width);
 
+	assert(cursor->image);
 	image = cursor->image;
-	if (image == NULL || transformed) {
+	if (transformed) {
 		image = sna->cursor.scratch;
 		cursor->last_width = cursor->last_height = size;
 	}
-- 
2.7.1



More information about the Intel-gfx mailing list