diff options
author | Ernestas Kulik <ernestas.kulik@gmail.com> | 2018-08-30 19:02:47 +0300 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-01-31 11:07:26 -0800 |
commit | 4d1dd3b0cdad7f3b5308440bed2c3cbfbee2756c (patch) | |
tree | bb2eeac58deeec7870fe0cf3b82bd35a613e07b6 | |
parent | 45d1aa2f6cf2230a0e9f54ac7a20a56e832859a1 (diff) |
vc4: Fix leak in HW queries error path
Reported by Coverity: in the case where there exist hardware and
non-hardware queries, the code does not jump to err_free_query and leaks
the query.
CID: 1430194
Signed-off-by: Ernestas Kulik <ernestas.kulik@gmail.com>
Fixes: 9ea90ffb98fb ("broadcom/vc4: Add support for HW perfmon")
(cherry picked from commit f6e49d5ad0fde19a074644491475470d684dd721)
-rw-r--r-- | src/gallium/drivers/vc4/vc4_query.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_query.c b/src/gallium/drivers/vc4/vc4_query.c index 6e4681e93cc..f08785f457f 100644 --- a/src/gallium/drivers/vc4/vc4_query.c +++ b/src/gallium/drivers/vc4/vc4_query.c @@ -132,7 +132,7 @@ vc4_create_batch_query(struct pipe_context *pctx, unsigned num_queries, /* We can't mix HW and non-HW queries. */ if (nhwqueries && nhwqueries != num_queries) - return NULL; + goto err_free_query; if (!nhwqueries) return (struct pipe_query *)query; |