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>
This commit is contained in:
parent
33af42e628
commit
f8d520950e
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue