From: Erik Faye-Lund Date: Wed, 27 Nov 2019 16:38:53 +0000 (+0100) Subject: zink: avoid NULL-deref X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c8769ff8dd2eb9c9698f9608f97256708d6f1009;p=mesa.git 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 --- 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); } }