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: f3cc0d2747 ("freedreno: import libdrm_freedreno + redesign submit")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6988
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17888>
This commit is contained in:
Rob Clark 2022-08-04 09:25:07 -07:00 committed by Marge Bot
parent 0a0205f045
commit 8b3f2a9e5d

View file

@ -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;
}
}