From 3dc00c33f08e0000fa2fead5ac96c8864be7d319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 5 Oct 2020 12:02:19 -0400 Subject: [PATCH] gallium/u_threaded_context: fix use-after-free in transfer_unmap discovered by valgrind Fixes: fd6a5e112aa Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/auxiliary/util/u_threaded_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 9d22fde6c6c..5b2968b9855 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -1610,9 +1610,9 @@ tc_transfer_unmap(struct pipe_context *_pipe, struct pipe_transfer *transfer) PIPE_MAP_DISCARD_RANGE))); struct pipe_context *pipe = tc->pipe; - pipe->transfer_unmap(pipe, transfer); util_range_add(&tres->b, tres->base_valid_buffer_range, transfer->box.x, transfer->box.x + transfer->box.width); + pipe->transfer_unmap(pipe, transfer); return; }