ac/spm: fix checking if the counter instance is valid

This should be compared against the number of global instances, and
there is also an off-by-one error.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25211>
This commit is contained in:
Samuel Pitoiset
2023-09-13 14:49:45 +02:00
committed by Marge Bot
parent 90d9406436
commit 6ae64900e2
+1 -1
View File
@@ -240,7 +240,7 @@ ac_spm_add_counter(const struct ac_perfcounters *pc,
}
/* Check if the number of instances is valid. */
if (info->b->instance > block->num_instances) {
if (info->b->instance > block->num_global_instances - 1) {
fprintf(stderr, "ac/spm: Invalid instance ID.\n");
return false;
}