From 8b3f2a9e5d49098a921de643916dd693f569d1bc Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 4 Aug 2022 09:25:07 -0700 Subject: [PATCH] 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 Part-of: --- 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; } }