diff options
author | Rajiv Andrade <srajiv@linux.vnet.ibm.com> | 2008-10-10 18:05:20 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-10-10 18:05:20 -0400 |
commit | 4bdec11f560b8f405a011288a50e65b1a81b3654 (patch) | |
tree | 92a8ad51fd1fa3a8dd4d2638cd6b20974cd0b15e /drivers | |
parent | 15c220d003f7914aab99cdb71cd7834a0c9b4557 (diff) |
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: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tpm/tpm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 02a495c2e068..1fee7034a386 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -1004,9 +1004,9 @@ int tpm_release(struct inode *inode, struct file *file) | |||
1004 | { | 1004 | { |
1005 | struct tpm_chip *chip = file->private_data; | 1005 | struct tpm_chip *chip = file->private_data; |
1006 | 1006 | ||
1007 | del_singleshot_timer_sync(&chip->user_read_timer); | ||
1007 | flush_scheduled_work(); | 1008 | flush_scheduled_work(); |
1008 | file->private_data = NULL; | 1009 | file->private_data = NULL; |
1009 | del_singleshot_timer_sync(&chip->user_read_timer); | ||
1010 | atomic_set(&chip->data_pending, 0); | 1010 | atomic_set(&chip->data_pending, 0); |
1011 | kfree(chip->data_buffer); | 1011 | kfree(chip->data_buffer); |
1012 | clear_bit(0, &chip->is_open); | 1012 | clear_bit(0, &chip->is_open); |