sna: Discard GPU bo when failing to setup the shared pixmap
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 22 Oct 2013 14:02:53 +0000 (15:02 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 22 Oct 2013 14:19:12 +0000 (15:19 +0100)
If we fail to mmap the pixmap when preparing it for use with prime, be
sure to throw away the now lost priv->gpu_bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_accel.c

index 31b4230..5446e10 100644 (file)
@@ -1183,6 +1183,7 @@ sna_create_pixmap_shared(struct sna *sna, ScreenPtr screen,
                pixmap->devPrivate.ptr =
                        kgem_bo_map__async(&sna->kgem, priv->gpu_bo);
                if (pixmap->devPrivate.ptr == NULL) {
+                       kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
                        free(priv);
                        FreePixmap(pixmap);
                        return FALSE;