Skip to content

Commit

Permalink
As pointed out by Jonathan Corbet, the timer must be deleted before
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rajiv Andrade authored and James Morris committed Oct 10, 2008
1 parent 15c220d commit 4bdec11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,9 +1004,9 @@ int tpm_release(struct inode *inode, struct file *file)
{
struct tpm_chip *chip = file->private_data;

del_singleshot_timer_sync(&chip->user_read_timer);
flush_scheduled_work();
file->private_data = NULL;
del_singleshot_timer_sync(&chip->user_read_timer);
atomic_set(&chip->data_pending, 0);
kfree(chip->data_buffer);
clear_bit(0, &chip->is_open);
Expand Down

0 comments on commit 4bdec11

Please sign in to comment.