Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292282
b: refs/heads/master
c: 3ab1aff
h: refs/heads/master
v: v3
  • Loading branch information
Tim Gardner authored and Rajiv Andrade committed Feb 14, 2012
1 parent cfdf9dc commit fb8f1da
Show file tree
Hide file tree
Showing 2 changed files with 3 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: 968de8e24d08fcc425e112ca465d4688b89b777b
refs/heads/master: 3ab1aff89477dafb1aaeafe8c8669114a02b7226
3 changes: 2 additions & 1 deletion trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,12 +1221,13 @@ ssize_t tpm_read(struct file *file, char __user *buf,
ret_size = atomic_read(&chip->data_pending);
atomic_set(&chip->data_pending, 0);
if (ret_size > 0) { /* relay data */
ssize_t orig_ret_size = ret_size;
if (size < ret_size)
ret_size = size;

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

Expand Down

0 comments on commit fb8f1da

Please sign in to comment.