From: Kylene Jo Hall Date: Fri, 18 Nov 2005 09:10:57 +0000 (-0800) Subject: [PATCH] tpm: use flush_scheduled_work() X-Git-Tag: v2.6.15-rc2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba3961152e7016237e15e3dfc18f08c1853d156b;p=platform%2Fkernel%2Flinux-exynos.git [PATCH] tpm: use flush_scheduled_work() Add the necessary flush_schedule_work calls when canceling the timer. Signed-off-by: Kylene Hall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 0b283d2..a9be0e8 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) file->private_data = NULL; chip->num_opens--; del_singleshot_timer_sync(&chip->user_read_timer); + flush_scheduled_work(); atomic_set(&chip->data_pending, 0); put_device(chip->dev); kfree(chip->data_buffer); @@ -428,6 +429,7 @@ ssize_t tpm_read(struct file * file, char __user *buf, int ret_size; del_singleshot_timer_sync(&chip->user_read_timer); + flush_scheduled_work(); ret_size = atomic_read(&chip->data_pending); atomic_set(&chip->data_pending, 0); if (ret_size > 0) { /* relay data */