diff mbox

[4/7] sna: assert a pointer is non-NULL before dereferencing it

Message ID 1455294689-29249-5-git-send-email-martin.peres@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Martin Peres Feb. 12, 2016, 4:31 p.m. UTC
Caught by Klockwork.

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
---
 src/sna/sna_accel.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Chris Wilson Feb. 12, 2016, 4:42 p.m. UTC | #1
On Fri, Feb 12, 2016 at 06:31:26PM +0200, Martin Peres wrote:
> Caught by Klockwork.

Impossible.
-Chris
diff mbox

Patch

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 8ceb1e1..f1c136a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4376,6 +4376,7 @@  sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
 
 	if (priv->shm) {
 		assert(!priv->flush);
+		assert(priv->cpu_bo);
 		sna_add_flush_pixmap(sna, priv, priv->cpu_bo);
 	}