panfrost: Fix write to free'd memory
[mesa.git] / src / panfrost / encoder / pan_bo.c
index 53249e8730192b3ee0127b742dde0faace0917d4..b25e91d5d2275caf9245d5993757962b594251bd 100644 (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);