summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/interrupt.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/interrupt.h')
-rw-r--r--src/vppinfra/interrupt.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vppinfra/interrupt.h b/src/vppinfra/interrupt.h
index 393574b076b..5c39b2183f8 100644
--- a/src/vppinfra/interrupt.h
+++ b/src/vppinfra/interrupt.h
@@ -110,6 +110,8 @@ clib_interrupt_get_next (void *in, int last)
ASSERT (last >= -1 && last < h->n_int);
off = (last + 1) >> log2_uword_bits;
+ if (off > h->n_int >> log2_uword_bits || off >= h->n_uword_alloc)
+ return -1;
last -= off << log2_uword_bits;
bmp[off] |= __atomic_exchange_n (abm + off, 0, __ATOMIC_SEQ_CST);
@@ -121,7 +123,7 @@ next:
off++;
- if (off > h->n_int >> log2_uword_bits)
+ if (off > h->n_int >> log2_uword_bits || off >= h->n_uword_alloc)
return -1;
bmp[off] |= __atomic_exchange_n (abm + off, 0, __ATOMIC_SEQ_CST);