From: Rajiv Andrade Date: Fri, 10 Oct 2008 22:05:20 +0000 (+1100) Subject: As pointed out by Jonathan Corbet, the timer must be deleted before X-Git-Tag: v2.6.28-rc1~609^2~1^2~1 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bdec11f560b8f405a011288a50e65b1a81b3654;p=pandora-kernel.git 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 Signed-off-by: Mimi Zohar Cc: Jonathan Corbet Cc: "Serge E. Hallyn" Signed-off-by: Andrew Morton Signed-off-by: James Morris --- 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) { 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);