Commit 4bdec11f authored by Rajiv Andrade's avatar Rajiv Andrade Committed by James Morris

As pointed out by Jonathan Corbet, the timer must be deleted before

flushing the work queue in order to avoid a job being submitted after the
chip had been released.
Signed-off-by: default avatarRajiv Andrade <srajiv@linux.vnet.ibm.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 15c220d0
...@@ -1004,9 +1004,9 @@ int tpm_release(struct inode *inode, struct file *file) ...@@ -1004,9 +1004,9 @@ int tpm_release(struct inode *inode, struct file *file)
{ {
struct tpm_chip *chip = file->private_data; struct tpm_chip *chip = file->private_data;
del_singleshot_timer_sync(&chip->user_read_timer);
flush_scheduled_work(); flush_scheduled_work();
file->private_data = NULL; file->private_data = NULL;
del_singleshot_timer_sync(&chip->user_read_timer);
atomic_set(&chip->data_pending, 0); atomic_set(&chip->data_pending, 0);
kfree(chip->data_buffer); kfree(chip->data_buffer);
clear_bit(0, &chip->is_open); clear_bit(0, &chip->is_open);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment