panfrost: Fix write to free'd memory

No clue how this worked before.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Fixes: 82f18b713a ("panfrost: Keep track of active BOs")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>
This commit is contained in:
Alyssa Rosenzweig 2020-07-09 19:13:59 -04:00 committed by Marge Bot
parent 20dd37024b
commit 37d89e0f93

View file

@ -502,7 +502,7 @@ panfrost_bo_import(struct panfrost_device *dev, int fd)
* acquired it in the meantime.
*/
if (p_atomic_read(&bo->refcnt) == 0)
p_atomic_set(&newbo->refcnt, 1);
p_atomic_set(&bo->refcnt, 1);
else
panfrost_bo_reference(bo);
assert(bo->cpu);