summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_batch.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-02-19 09:29:49 -0500
committerRob Clark <[email protected]>2019-02-22 14:05:32 -0500
commit5d4fa194b8768701a7df1545cf10929ab4b67a23 (patch)
tree49142789a0eb0799d4050c71110d95e8a30e5134 /src/gallium/drivers/freedreno/freedreno_batch.c
parent3090c6b9e9c114b3438be83399c7bed12f920505 (diff)
freedreno: fix race condition
rsc->write_batch can be cleared behind our back, so we need to acquire the lock *before* deref'ing. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_batch.c')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_batch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c b/src/gallium/drivers/freedreno/freedreno_batch.c
index a1578506c2a..84dfa898c51 100644
--- a/src/gallium/drivers/freedreno/freedreno_batch.c
+++ b/src/gallium/drivers/freedreno/freedreno_batch.c
@@ -433,7 +433,7 @@ static void
flush_write_batch(struct fd_resource *rsc)
{
struct fd_batch *b = NULL;
- fd_batch_reference(&b, rsc->write_batch);
+ fd_batch_reference_locked(&b, rsc->write_batch);
mtx_unlock(&b->ctx->screen->lock);
fd_batch_flush(b, true, false);