rem: long rv = EINVAL;
add: long status = EINVAL;
context: remove_interrupt_handler(long vector, interrupt_handler handler, void *data){	struct io_handler *io = NULL;	long rv = EINVAL;	int state;	if (vector < 0 || vector >= NUM_IO_VECTORS)		return B_BAD_VALUE;	/* lock the structures down so it is not modified while we search */	state = disable_interrupts();	acquire_spinlock(&io_vectors[vector].vector_lock);	/* loop through the available handlers and try to find a match.	 * We go forward through the list but this means we start with the	 * most recently added handlers.	 */	for (io = io_vectors[vector].handler_list.next;	     io != &io_vectors[vector].handler_list;	     io = io->next) {		/* we have to match both function and data */		if (io->func == handler && io->data == data) {			remque(io);			free(io); // XXX free() should not be called inside a spinlock or with disabled interrupts			rv = 0;			break;		}	}	/* to finish we need to release our locks and return	 * the value rv	 */	release_spinlock(&io_vectors[vector].vector_lock);	restore_interrupts(state);	return rv;} 