diff options
author | Erik Faye-Lund <[email protected]> | 2019-11-27 17:34:08 +0100 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-11-29 09:54:25 +0100 |
commit | e54240f1531ac58f2eefb8df7294a12f187c1cc5 (patch) | |
tree | b81fa255f137e7cfb279873158f84d8bfb1a011b /src/gallium/drivers | |
parent | bda64440e45233d0bfd51b9c1596ae3a1788c3fd (diff) |
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/zink/zink_batch.c | 3 |
1 files changed, 1 insertions, 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); } } |