aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-06-02 10:36:23 -0400
committerRob Clark <[email protected]>2016-06-02 15:44:07 -0400
commit1632b0eac02cd8911c04115cb6b4693f7dcb16bb (patch)
tree9aebb9c8900657cf333a31e93454a9d171e587fa /src/gallium/drivers/freedreno
parentba452d43e0f5ee6ceec5da031f55904f8144472c (diff)
freedreno: fix coverity negative array index warning
Never can happen, since query would not have been created in the first place if pidx(query_type) return negative. Lets let coverity realize this. CID 1362460 Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_query_hw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_query_hw.c b/src/gallium/drivers/freedreno/freedreno_query_hw.c
index 2ac03f22b41..04452efadcd 100644
--- a/src/gallium/drivers/freedreno/freedreno_query_hw.c
+++ b/src/gallium/drivers/freedreno/freedreno_query_hw.c
@@ -61,6 +61,8 @@ get_sample(struct fd_context *ctx, struct fd_ringbuffer *ring,
struct fd_hw_sample *samp = NULL;
int idx = pidx(query_type);
+ assume(idx >= 0); /* query never would have been created otherwise */
+
if (!ctx->sample_cache[idx]) {
ctx->sample_cache[idx] =
ctx->sample_providers[idx]->get_sample(ctx, ring);