X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Finterrupt.h;h=5c39b2183f80fa7e9d33c22cfe673d4e10d33370;hb=206592bb731e6668d2b8f2e01479998cc1ec60d5;hp=393574b076bf8cf61b9f519c5607a0218312c299;hpb=7b90f669d83f432f3610ec0da522bd8ccc4dff01;p=vpp.git 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);