lkml.org 
[lkml]   [2008]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5/5] TPM: Fixed tpm_release() timing
    Date
    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>
    ---
    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 ab03b4d..8d090d3 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);
    --
    1.5.6.3


    \
     
     \ /
      Last update: 2008-10-03 18:33    [W:2.315 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site