iris: Only mark buffer as exported if drmPrimeHandleToFD() succeed
Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21966>
This commit is contained in:

committed by
Marge Bot

parent
596f2ef361
commit
7f65b94451
@@ -1864,12 +1864,12 @@ iris_bo_export_dmabuf(struct iris_bo *bo, int *prime_fd)
|
|||||||
/* We cannot export suballocated BOs. */
|
/* We cannot export suballocated BOs. */
|
||||||
assert(iris_bo_is_real(bo));
|
assert(iris_bo_is_real(bo));
|
||||||
|
|
||||||
iris_bo_mark_exported(bo);
|
|
||||||
|
|
||||||
if (drmPrimeHandleToFD(bufmgr->fd, bo->gem_handle,
|
if (drmPrimeHandleToFD(bufmgr->fd, bo->gem_handle,
|
||||||
DRM_CLOEXEC | DRM_RDWR, prime_fd) != 0)
|
DRM_CLOEXEC | DRM_RDWR, prime_fd) != 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
|
iris_bo_mark_exported(bo);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user