nouveau/winsys: Take a reference to BOs found in the cache

Fixes: c370260a8f ("nouveau/winsys: Add dma-buf import support")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24795>
This commit is contained in:
Faith Ekstrand 2024-05-09 14:33:16 -05:00 committed by Marge Bot
parent d63f015d0b
commit 19b143b7bc

View file

@ -269,8 +269,11 @@ nouveau_ws_bo_from_dma_buf_locked(struct nouveau_ws_device *dev, int fd)
struct hash_entry *entry =
_mesa_hash_table_search(dev->bos, (void *)(uintptr_t)handle);
if (entry != NULL)
return entry->data;
if (entry != NULL) {
struct nouveau_ws_bo *bo = entry->data;
nouveau_ws_bo_ref(bo);
return bo;
}
/*
* If we got here, no BO exists for the retrieved handle. If we error