Mesa (master): zink: avoid NULL-deref
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Nov 29 09:19:23 UTC 2019
Module: Mesa
Branch: master
Commit: e54240f1531ac58f2eefb8df7294a12f187c1cc5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e54240f1531ac58f2eefb8df7294a12f187c1cc5
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Wed Nov 27 17:34:08 2019 +0100
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 at redhat.com>
---
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 74700acb340..c31e175d6d6 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -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);
}
}
More information about the mesa-commit
mailing list