From c8769ff8dd2eb9c9698f9608f97256708d6f1009 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 27 Nov 2019 17:38:53 +0100 Subject: [PATCH] zink: avoid NULL-deref Same story as the previous two commits; these functions dereference the memory they are pointed at. We can't do that. CoverityID: 1455180 Reviewed-by: Dave Airlie --- src/gallium/drivers/zink/zink_batch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_batch.c b/src/gallium/drivers/zink/zink_batch.c index c31e175d6d6..a73128d4993 100644 --- a/src/gallium/drivers/zink/zink_batch.c +++ b/src/gallium/drivers/zink/zink_batch.c @@ -113,8 +113,7 @@ zink_batch_reference_sampler_view(struct zink_batch *batch, { struct set_entry *entry = _mesa_set_search(batch->sampler_views, sv); if (!entry) { - struct pipe_sampler_view *tmp = NULL; entry = _mesa_set_add(batch->sampler_views, sv); - pipe_sampler_view_reference(&tmp, &sv->base); + pipe_reference(NULL, &sv->base.reference); } } -- 2.30.2