if ((remoteLp >= HvMaxArchitectedLps) || (remoteLp == HvLpIndexInvalid)) 
if ((remoteLp >= HVMAXARCHITECTEDLPS) || (remoteLp == HvLpIndexInvalid)) 
int viopath_close(HvLpIndex remoteLp, int subtype, int numReq){	unsigned long flags;	int i;	int numOpen;	struct alloc_parms parms;	if ((remoteLp >= HvMaxArchitectedLps) || (remoteLp == HvLpIndexInvalid))		return -EINVAL;	subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;	if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES))		return -EINVAL;	spin_lock_irqsave(&statuslock, flags);	/*	 * If the viopath_close somehow gets called before a	 * viopath_open it could decrement to -1 which is a non	 * recoverable state so we'll prevent this from	 * happening.	 */	if (viopathStatus[remoteLp].users[subtype] > 0)		viopathStatus[remoteLp].users[subtype]--;	spin_unlock_irqrestore(&statuslock, flags);	parms.used_wait_atomic = 0;	init_MUTEX_LOCKED(&parms.sem);	mf_deallocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo,			      numReq, &viopath_donealloc, &parms);	down(&parms.sem);	spin_lock_irqsave(&statuslock, flags);	for (i = 0, numOpen = 0; i < VIO_MAX_SUBTYPES; i++)		numOpen += viopathStatus[remoteLp].users[i];	if ((viopathStatus[remoteLp].isOpen) && (numOpen == 0)) {		printk(VIOPATH_KERN_INFO "closing connection to partition %d",				remoteLp);		HvCallEvent_closeLpEventPath(remoteLp,					     HvLpEvent_Type_VirtualIo);		viopathStatus[remoteLp].isOpen = 0;		viopathStatus[remoteLp].isActive = 0;		for (i = 0; i < VIO_MAX_SUBTYPES; i++)			atomic_set(&event_buffer_available[i], 0);		event_buffer_initialised = 0;	}	spin_unlock_irqrestore(&statuslock, flags);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c670b1acd0ed0d9f7a27154759a9825cb5012ae4/viopath.c/buggy/arch/ppc64/kernel/viopath.c