[Intel-gfx] [PATCH igt 2/6] instdone: Add an assert to make sure we never overflow instdone_bits

Damien Lespiau damien.lespiau at intel.com
Mon Jan 6 16:02:30 CET 2014


Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 lib/instdone.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/instdone.c b/lib/instdone.c
index b4d51f0..1399df7 100644
--- a/lib/instdone.c
+++ b/lib/instdone.c
@@ -37,6 +37,7 @@ int num_instdone_bits = 0;
 static void
 add_instdone_bit(uint32_t reg, uint32_t bit, const char *name)
 {
+	assert(num_instdone_bits < MAX_INSTDONE_BITS);
 	instdone_bits[num_instdone_bits].reg = reg;
 	instdone_bits[num_instdone_bits].bit = bit;
 	instdone_bits[num_instdone_bits].name = name;
-- 
1.8.3.1




More information about the Intel-gfx mailing list