Mesa (staging/20.0): iris: fix BO destruction in error path

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 9 18:01:49 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: 746e76675d6a27a07de2d0ed906e8897c968b991
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=746e76675d6a27a07de2d0ed906e8897c968b991

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>
(cherry picked from commit 604a86e46f67b517e43c4646080ee1993ff95ecd)

---

 .pick_status.json                      | 2 +-
 src/gallium/drivers/iris/iris_bufmgr.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 0d2961a64a4..b331b3c8bf2 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1003,7 +1003,7 @@
         "description": "iris: fix BO destruction in error path",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c
index c333f7bdaee..825553b3e31 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -592,6 +592,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();
@@ -637,7 +638,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