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 <airlied@redhat.com>
This commit is contained in:
Erik Faye-Lund
2019-11-27 17:38:53 +01:00
parent e54240f153
commit c8769ff8dd
+1 -2
View File
@@ -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);
}
}