From 857c22e5ecf016bcd15508fec6e6d435bf69b58d Mon Sep 17 00:00:00 2001 From: Varad Gautam Date: Fri, 21 Aug 2015 22:14:33 +0530 Subject: [PATCH] freedreno: fix a bo cache segfault with imported bo's Importing a bo whose handle is still in the bo cache crashes during cleanup. Remove bo from cache when importing. Signed-off-by: Varad Gautam Signed-off-by: Rob Clark --- freedreno/freedreno_bo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/freedreno/freedreno_bo.c b/freedreno/freedreno_bo.c index eec218c..972ee17 100644 --- a/freedreno/freedreno_bo.c +++ b/freedreno/freedreno_bo.c @@ -52,6 +52,9 @@ static struct fd_bo * lookup_bo(void *tbl, uint32_t key) if (!drmHashLookup(tbl, key, (void **)&bo)) { /* found, incr refcnt and return: */ bo = fd_bo_ref(bo); + + /* don't break the bucket if this bo was found in one */ + list_delinit(&bo->list); } return bo; } -- 2.7.4