mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
pan/bo: Make sure we catch refcnt underflows
Recently had to debug an unbalanced ref/unref situation in some code I added, and having an assert(refcnt > 0) in panfrost_bo_unreference() would have made this simpler, so let's add one. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26221>
This commit is contained in:
parent
46d2748a93
commit
790d4422b2
1 changed files with 1 additions and 0 deletions
|
|
@ -431,6 +431,7 @@ panfrost_bo_unreference(struct panfrost_bo *bo)
|
|||
return;
|
||||
|
||||
/* Don't return to cache if there are still references */
|
||||
assert(p_atomic_read(&bo->refcnt) > 0);
|
||||
if (p_atomic_dec_return(&bo->refcnt))
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue