zink: avoid NULL-deref

Similar to the previous commit, pipe_resource_reference also dereference
the memory pointed at. Let's avoid it.

CoverityID: 1455198
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Erik Faye-Lund
2019-11-27 17:34:08 +01:00
parent bda64440e4
commit e54240f153
+1 -2
View File
@@ -102,9 +102,8 @@ zink_batch_reference_resoure(struct zink_batch *batch,
{
struct set_entry *entry = _mesa_set_search(batch->resources, res);
if (!entry) {
struct pipe_resource *tmp = NULL;
entry = _mesa_set_add(batch->resources, res);
pipe_resource_reference(&tmp, &res->base);
pipe_reference(NULL, &res->base.reference);
}
}