From 604a86e46f67b517e43c4646080ee1993ff95ecd Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sat, 2 May 2020 22:43:22 +0300 Subject: [PATCH] iris: fix BO destruction in error path MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Lionel Landwerlin Cc: Tested-by: Tapani Pälli Reviewed-by: Ian Romanick Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/iris/iris_bufmgr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.30.2