Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329089
b: refs/heads/master
c: dd7da13
h: refs/heads/master
i:
  329087: 96830df
v: v3
  • Loading branch information
Kent Yoder committed Aug 22, 2012
1 parent 2d224df commit 6782146
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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: 578b016fdc91464c08c096f0c5952cae549fdb8f
refs/heads/master: dd7da132f7f04f34074efd134847a818ea29ddd7
5 changes: 3 additions & 2 deletions trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ int tpm_release(struct inode *inode, struct file *file)
flush_work_sync(&chip->work);
file->private_data = NULL;
atomic_set(&chip->data_pending, 0);
kfree(chip->data_buffer);
kzfree(chip->data_buffer);
clear_bit(0, &chip->is_open);
put_device(chip->dev);
return 0;
Expand Down Expand Up @@ -1223,7 +1223,6 @@ ssize_t tpm_read(struct file *file, char __user *buf,
del_singleshot_timer_sync(&chip->user_read_timer);
flush_work_sync(&chip->work);
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)
Expand All @@ -1238,6 +1237,8 @@ ssize_t tpm_read(struct file *file, char __user *buf,
mutex_unlock(&chip->buffer_mutex);
}

atomic_set(&chip->data_pending, 0);

return ret_size;
}
EXPORT_SYMBOL_GPL(tpm_read);
Expand Down

0 comments on commit 6782146

Please sign in to comment.