Index: sys/x86/x86/intr_machdep.c =================================================================== --- sys/x86/x86/intr_machdep.c +++ sys/x86/x86/intr_machdep.c @@ -221,12 +221,13 @@ int intr_register_source(struct intsrc *isrc) { - int error, vector; + u_int vector; + int error; KASSERT(intr_pic_registered(isrc->is_pic), ("unregistered PIC")); vector = isrc->is_pic->pic_vector(isrc); - KASSERT(vector < num_io_irqs, ("IRQ %d too large (%u irqs)", vector, - num_io_irqs)); + if (vector >= num_io_irqs) + return (EINVAL); if (interrupt_sources[vector] != NULL) return (EEXIST); error = intr_event_create(&isrc->is_event, isrc, 0, vector,