down(&usblp->sem); 
static ssize_t usblp_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos){	struct usblp *usblp = file->private_data;	DECLARE_WAITQUEUE(wait, current);	if (!usblp->bidir)		return -EINVAL;	down (&usblp->sem);	if (!usblp->present) {		count = -ENODEV;		goto done;	}	if (!usblp->rcomplete) {		barrier();		if (file->f_flags & O_NONBLOCK) {			count = -EAGAIN;			goto done;		}		add_wait_queue(&usblp->wait, &wait);		while (1==1) {			if (signal_pending(current)) {				count = -EINTR;				remove_wait_queue(&usblp->wait, &wait);				goto done;			}			up (&usblp->sem);			set_current_state(TASK_INTERRUPTIBLE);			if (!usblp->rcomplete) {				schedule();			} else {				set_current_state(TASK_RUNNING);				break;			}			down (&usblp->sem);		}		remove_wait_queue(&usblp->wait, &wait);	}	if (!usblp->present) {		count = -ENODEV;		goto done;	}	if (usblp->readurb->status) {		err("usblp%d: error %d reading from printer",			usblp->minor, usblp->readurb->status);		usblp->readurb->dev = usblp->dev; 		usblp->readcount = 0;		usblp->rcomplete = 0;		if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0)			dbg("error submitting urb");		count = -EIO;		goto done;	}	count = count < usblp->readurb->actual_length - usblp->readcount ?		count :	usblp->readurb->actual_length - usblp->readcount;	if (copy_to_user(buffer, usblp->readurb->transfer_buffer + usblp->readcount, count)) {		count = -EFAULT;		goto done;	}	if ((usblp->readcount += count) == usblp->readurb->actual_length) {		usblp->readcount = 0;		usblp->readurb->dev = usblp->dev;		usblp->rcomplete = 0;		if (usb_submit_urb(usblp->readurb, GFP_KERNEL)) {			count = -EIO;			goto done;		}	}done:	up (&usblp->sem);	return count;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/01205a0e60bb5a66d768b881fb8355981b912510/usblp.c/buggy/drivers/usb/class/usblp.c