diff options
author | Rob Clark <[email protected]> | 2019-02-19 09:29:49 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-02-22 14:05:32 -0500 |
commit | 5d4fa194b8768701a7df1545cf10929ab4b67a23 (patch) | |
tree | 49142789a0eb0799d4050c71110d95e8a30e5134 /src/gallium/drivers/freedreno/freedreno_batch.c | |
parent | 3090c6b9e9c114b3438be83399c7bed12f920505 (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.c | 2 |
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); |