sna: Assert that the mapping is released before closing the GEM handle

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-05-14 15:22:59 +01:00
parent 16a64649e9
commit bb0969e6a5
1 changed files with 3 additions and 1 deletions

View File

@ -1499,6 +1499,7 @@ static void kgem_bo_free(struct kgem *kgem, struct kgem_bo *bo)
if (bo->map)
kgem_bo_release_map(kgem, bo);
assert(list_is_empty(&bo->vma));
assert(bo->map == NULL);
_list_del(&bo->list);
_list_del(&bo->request);
@ -2182,6 +2183,7 @@ static void kgem_commit(struct kgem *kgem)
kgem_retire(kgem);
assert(list_is_empty(&rq->buffers));
assert(rq->bo->map == NULL);
gem_close(kgem->fd, rq->bo->handle);
kgem_cleanup_cache(kgem);
} else {
@ -5796,7 +5798,7 @@ kgem_replace_bo(struct kgem *kgem,
return NULL;
dst = __kgem_bo_alloc(handle, size);
if (dst== NULL) {
if (dst == NULL) {
gem_close(kgem->fd, handle);
return NULL;
}