mirror of
https://github.com/opnsense/src.git
synced 2026-04-22 14:49:36 -04:00
PPC: Add KASSERT in intrcnt_add which checks for buffer overflow
Authored by: Patryk Duda <pdk@semihalf.com> Submitted by: Wojciech Macek <wma@semihalf.com> Obtained from: Semihalf Sponsored by: IBM, QCM Technologies
This commit is contained in:
parent
6fb1399a4c
commit
68c2d255bc
1 changed files with 2 additions and 0 deletions
|
|
@ -178,6 +178,8 @@ intrcnt_add(const char *name, u_long **countp)
|
|||
int idx;
|
||||
|
||||
idx = atomic_fetchadd_int(&intrcnt_index, 1);
|
||||
KASSERT(idx < INTR_VECTORS, ("intrcnt_add: Interrupt counter index "
|
||||
"reached INTR_VECTORS"));
|
||||
*countp = &intrcnt[idx];
|
||||
intrcnt_setname(name, idx);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue