From: Alyssa Rosenzweig Date: Thu, 9 Jul 2020 23:13:59 +0000 (-0400) Subject: panfrost: Fix write to free'd memory X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=37d89e0f93601e520edcdc41dc68197dff736c1e;p=mesa.git panfrost: Fix write to free'd memory No clue how this worked before. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Fixes: 82f18b713ac ("panfrost: Keep track of active BOs") Cc: mesa-stable Part-of: --- diff --git a/src/panfrost/encoder/pan_bo.c b/src/panfrost/encoder/pan_bo.c index 53249e87301..b25e91d5d22 100644 --- a/src/panfrost/encoder/pan_bo.c +++ b/src/panfrost/encoder/pan_bo.c @@ -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);