Module: Mesa
Branch: main
Commit: 8b3f2a9e5d49098a921de643916dd693f569d1bc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8b3f2a9e5d49098a921de643916dd693f569d1bc

Author: Rob Clark <[email protected]>
Date:   Thu Aug  4 09:25:07 2022 -0700

freedreno/drm: Fix potential bo cache vs export crash

Keep the list head valid (empty) after allocation from bo cache.  Avoids
a potential later crash in lookup_bo in the following sequence:

1. alloc, bo cache hit
2. export
3. re-import

Cc: mesa-stable
Fixes: f3cc0d27475 ("freedreno: import libdrm_freedreno + redesign submit")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6988
Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17888>

---

 src/freedreno/drm/freedreno_bo_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/freedreno/drm/freedreno_bo_cache.c 
b/src/freedreno/drm/freedreno_bo_cache.c
index c7b1c1ca47d..34f089c8f32 100644
--- a/src/freedreno/drm/freedreno_bo_cache.c
+++ b/src/freedreno/drm/freedreno_bo_cache.c
@@ -142,7 +142,7 @@ find_in_bucket(struct fd_bo_bucket *bucket, uint32_t flags)
          break;
       if (entry->alloc_flags == flags) {
          bo = entry;
-         list_del(&bo->list);
+         list_delinit(&bo->list);
          break;
       }
    }

Reply via email to