Mesa (master): iris: fix BO destruction in error path
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 4 07:53:07 UTC 2020
Module: Mesa
Branch: master
Commit: 604a86e46f67b517e43c4646080ee1993ff95ecd
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=604a86e46f67b517e43c4646080ee1993ff95ecd
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Sat May 2 22:43:22 2020 +0300
iris: fix BO destruction in error path
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Cc: <mesa-stable at lists.freedesktop.org>
Tested-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4861>
---
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;
More information about the mesa-commit
mailing list