Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264077
b: refs/heads/master
c: 3321c07
h: refs/heads/master
i:
  264075: 1c258a8
v: v3
  • Loading branch information
Peter Huewe authored and James Morris committed Sep 22, 2011
1 parent 653ea3d commit 7643e49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b07d30aca7e52f2881b8c8c20c8a2cd28e8b3d3
refs/heads/master: 3321c07ae5068568cd61ac9f4ba749006a7185c9
6 changes: 5 additions & 1 deletion trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@ ssize_t tpm_read(struct file *file, char __user *buf,
{
struct tpm_chip *chip = file->private_data;
ssize_t ret_size;
int rc;

del_singleshot_timer_sync(&chip->user_read_timer);
flush_work_sync(&chip->work);
Expand All @@ -1115,8 +1116,11 @@ ssize_t tpm_read(struct file *file, char __user *buf,
ret_size = size;

mutex_lock(&chip->buffer_mutex);
if (copy_to_user(buf, chip->data_buffer, ret_size))
rc = copy_to_user(buf, chip->data_buffer, ret_size);
memset(chip->data_buffer, 0, ret_size);
if (rc)
ret_size = -EFAULT;

mutex_unlock(&chip->buffer_mutex);
}

Expand Down

0 comments on commit 7643e49

Please sign in to comment.