aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm
diff options
context:
space:
mode:
authorKylene Jo Hall <kjhall@us.ibm.com>2005-11-18 04:10:57 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-18 10:49:45 -0500
commitba3961152e7016237e15e3dfc18f08c1853d156b (patch)
treeeef7380031f0e267ce78499f66b04edc2e51a0aa /drivers/char/tpm
parent966cc04b4d9d3d7a49e744888628acc36ebec5d4 (diff)
[PATCH] tpm: use flush_scheduled_work()
Add the necessary flush_schedule_work calls when canceling the timer. Signed-off-by: Kylene Hall <kjhall@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/tpm')
-rw-r--r--drivers/char/tpm/tpm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 0b283d246730..a9be0e8eaea5 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -377,6 +377,7 @@ int tpm_release(struct inode *inode, struct file *file)
377 file->private_data = NULL; 377 file->private_data = NULL;
378 chip->num_opens--; 378 chip->num_opens--;
379 del_singleshot_timer_sync(&chip->user_read_timer); 379 del_singleshot_timer_sync(&chip->user_read_timer);
380 flush_scheduled_work();
380 atomic_set(&chip->data_pending, 0); 381 atomic_set(&chip->data_pending, 0);
381 put_device(chip->dev); 382 put_device(chip->dev);
382 kfree(chip->data_buffer); 383 kfree(chip->data_buffer);
@@ -428,6 +429,7 @@ ssize_t tpm_read(struct file * file, char __user *buf,
428 int ret_size; 429 int ret_size;
429 430
430 del_singleshot_timer_sync(&chip->user_read_timer); 431 del_singleshot_timer_sync(&chip->user_read_timer);
432 flush_scheduled_work();
431 ret_size = atomic_read(&chip->data_pending); 433 ret_size = atomic_read(&chip->data_pending);
432 atomic_set(&chip->data_pending, 0); 434 atomic_set(&chip->data_pending, 0);
433 if (ret_size > 0) { /* relay data */ 435 if (ret_size > 0) { /* relay data */