提交 ba396115 编写于 作者: K Kylene Jo Hall 提交者: Linus Torvalds

[PATCH] tpm: use flush_scheduled_work()

Add the necessary flush_schedule_work calls when canceling the timer.
Signed-off-by: NKylene Hall <kjhall@us.ibm.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 966cc04b
...@@ -377,6 +377,7 @@ int tpm_release(struct inode *inode, struct file *file) ...@@ -377,6 +377,7 @@ int tpm_release(struct inode *inode, struct file *file)
file->private_data = NULL; file->private_data = NULL;
chip->num_opens--; chip->num_opens--;
del_singleshot_timer_sync(&chip->user_read_timer); del_singleshot_timer_sync(&chip->user_read_timer);
flush_scheduled_work();
atomic_set(&chip->data_pending, 0); atomic_set(&chip->data_pending, 0);
put_device(chip->dev); put_device(chip->dev);
kfree(chip->data_buffer); kfree(chip->data_buffer);
...@@ -428,6 +429,7 @@ ssize_t tpm_read(struct file * file, char __user *buf, ...@@ -428,6 +429,7 @@ ssize_t tpm_read(struct file * file, char __user *buf,
int ret_size; int ret_size;
del_singleshot_timer_sync(&chip->user_read_timer); del_singleshot_timer_sync(&chip->user_read_timer);
flush_scheduled_work();
ret_size = atomic_read(&chip->data_pending); ret_size = atomic_read(&chip->data_pending);
atomic_set(&chip->data_pending, 0); atomic_set(&chip->data_pending, 0);
if (ret_size > 0) { /* relay data */ if (ret_size > 0) { /* relay data */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册