From: Lionel Landwerlin Date: Sat, 2 May 2020 19:43:22 +0000 (+0300) Subject: iris: fix BO destruction in error path X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=604a86e46f67b517e43c4646080ee1993ff95ecd;p=mesa.git iris: fix BO destruction in error path Signed-off-by: Lionel Landwerlin Cc: Tested-by: Tapani Pälli Reviewed-by: Ian Romanick Reviewed-by: Kenneth Graunke Part-of: --- diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index cad15bea08a..f2cd53b4495 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -588,6 +588,7 @@ iris_bo_create_userptr(struct iris_bufmgr *bufmgr, const char *name, void *ptr, size_t size, enum iris_memory_zone memzone) { + struct drm_gem_close close = { 0, }; struct iris_bo *bo; bo = bo_calloc(); @@ -633,7 +634,8 @@ iris_bo_create_userptr(struct iris_bufmgr *bufmgr, const char *name, return bo; err_close: - gen_ioctl(bufmgr->fd, DRM_IOCTL_GEM_CLOSE, &bo->gem_handle); + close.handle = bo->gem_handle; + gen_ioctl(bufmgr->fd, DRM_IOCTL_GEM_CLOSE, &close); err_free: free(bo); return NULL;