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
@ -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…
x
Reference in New Issue
Block a user