diff options
-rw-r--r-- | drivers/char/tpm/tpm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 0b283d246730..a9be0e8eaea5 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -377,6 +377,7 @@ int tpm_release(struct inode *inode, struct file *file) | |||
377 | file->private_data = NULL; | 377 | file->private_data = NULL; |
378 | chip->num_opens--; | 378 | chip->num_opens--; |
379 | del_singleshot_timer_sync(&chip->user_read_timer); | 379 | del_singleshot_timer_sync(&chip->user_read_timer); |
380 | flush_scheduled_work(); | ||
380 | atomic_set(&chip->data_pending, 0); | 381 | atomic_set(&chip->data_pending, 0); |
381 | put_device(chip->dev); | 382 | put_device(chip->dev); |
382 | kfree(chip->data_buffer); | 383 | kfree(chip->data_buffer); |
@@ -428,6 +429,7 @@ ssize_t tpm_read(struct file * file, char __user *buf, | |||
428 | int ret_size; | 429 | int ret_size; |
429 | 430 | ||
430 | del_singleshot_timer_sync(&chip->user_read_timer); | 431 | del_singleshot_timer_sync(&chip->user_read_timer); |
432 | flush_scheduled_work(); | ||
431 | ret_size = atomic_read(&chip->data_pending); | 433 | ret_size = atomic_read(&chip->data_pending); |
432 | atomic_set(&chip->data_pending, 0); | 434 | atomic_set(&chip->data_pending, 0); |
433 | if (ret_size > 0) { /* relay data */ | 435 | if (ret_size > 0) { /* relay data */ |