summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-08 12:13:36 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-08 12:18:11 +0000
commitf8d520950edb5cec878999a09d3f7e6f8b15bf5e (patch)
treed60c8886a4e9ea42fff4db42569b3203193922e5
parent33af42e6284f104ed3c4cdba4bf3b1c29322ce9c (diff)
sna: Avoid NULL deference in DBG
Only print out the details of the allocated CPU bo, if we actually allocate it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index a1798a5e..08ee5374 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -313,10 +313,10 @@ sna_pixmap_alloc_cpu(struct sna *sna,
pixmap->drawable.height,
pixmap->drawable.bitsPerPixel,
from_gpu ? 0 : CREATE_CPU_MAP | CREATE_INACTIVE);
- DBG(("%s: allocated CPU handle=%d\n", __FUNCTION__,
- priv->cpu_bo->handle));
-
if (priv->cpu_bo) {
+ DBG(("%s: allocated CPU handle=%d\n", __FUNCTION__,
+ priv->cpu_bo->handle));
+
priv->ptr = kgem_bo_map__cpu(&sna->kgem, priv->cpu_bo);
priv->stride = priv->cpu_bo->pitch;
}