oce_if: fix oout of bounds access

Change-Id: Id052d9e7714c0251e39384671da9a0f76f6c13c4
Reviewed-on: https://review.haiku-os.org/c/1682
Reviewed-by: Rene Gollent <rene@gollent.com>
This commit is contained in:
Adrien Destugues 2019-08-05 18:54:17 +02:00 committed by waddlesplash
parent af0be8dbc5
commit ec2b89264c
1 changed files with 3 additions and 1 deletions

View File

@ -799,12 +799,14 @@ oce_fast_isr(void *arg)
static int
oce_alloc_intr(POCE_SOFTC sc, int vector, void (*isr) (void *arg, int pending))
{
POCE_INTR_INFO ii = &sc->intrs[vector];
POCE_INTR_INFO ii;
int rc = 0, rr;
if (vector >= OCE_MAX_EQ)
return (EINVAL);
ii = &sc->intrs[vector];
/* Set the resource id for the interrupt.
* MSIx is vector + 1 for the resource id,
* INTx is 0 for the resource id.