if (atomic_read(&chip->data_pending) != 0) {	/* Result available */ down(&chip->timer_manipulation_mutex); del_singleshot_timer_sync(&chip->user_read_timer); up(&chip->timer_manipulation_mutex); 
del_singleshot_timer_sync(&chip->user_read_timer); ret_size = atomic_read(&chip->data_pending); atomic_set(&chip->data_pending, 0); if (ret_size > 0) {	/* relay data */ if (size < ret_size) ret_size = size; 
ssize_t tpm_read(struct file * file, char __user * buf,		 size_t size, loff_t * off){	struct tpm_chip *chip = file->private_data;	int ret_size = -ENODATA;	if (atomic_read(&chip->data_pending) != 0) {	/* Result available */		down(&chip->timer_manipulation_mutex);		del_singleshot_timer_sync(&chip->user_read_timer);		up(&chip->timer_manipulation_mutex);		down(&chip->buffer_mutex);		ret_size = atomic_read(&chip->data_pending);		atomic_set(&chip->data_pending, 0);		if (ret_size == 0)	/* timeout just occurred */			ret_size = -ETIME;		else if (ret_size > 0) {	/* relay data */			if (size < ret_size)				ret_size = size;			if (copy_to_user((void __user *) buf,					 chip->data_buffer, ret_size)) {				ret_size = -EFAULT;			}		}		up(&chip->buffer_mutex);	}	return ret_size;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/5b44bd58063f7839f42a4047843e93e1fbf73cda/tpm.c/buggy/drivers/char/tpm/tpm.c