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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Damien Lespiau <damien.lespiau@xxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux