diff options
Diffstat (limited to 'drivers/char/tpm/tpm.c')
-rw-r--r-- | drivers/char/tpm/tpm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 303f15880466..1a53da99b58f 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -428,8 +428,7 @@ ssize_t tpm_read(struct file * file, char __user *buf, | |||
428 | ret_size = size; | 428 | ret_size = size; |
429 | 429 | ||
430 | down(&chip->buffer_mutex); | 430 | down(&chip->buffer_mutex); |
431 | if (copy_to_user | 431 | if (copy_to_user(buf, chip->data_buffer, ret_size)) |
432 | ((void __user *) buf, chip->data_buffer, ret_size)) | ||
433 | ret_size = -EFAULT; | 432 | ret_size = -EFAULT; |
434 | up(&chip->buffer_mutex); | 433 | up(&chip->buffer_mutex); |
435 | } | 434 | } |
@@ -460,7 +459,7 @@ void tpm_remove_hardware(struct device *dev) | |||
460 | sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); | 459 | sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); |
461 | 460 | ||
462 | dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= | 461 | dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= |
463 | !(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); | 462 | ~(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); |
464 | 463 | ||
465 | kfree(chip); | 464 | kfree(chip); |
466 | 465 | ||