sna: Discard GPU bo when failing to setup the shared pixmap

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>
This commit is contained in:
Chris Wilson 2013-10-22 15:02:53 +01:00
parent c0f31d822a
commit 0d18b39565
1 changed files with 1 additions and 0 deletions

View 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;