Loading drivers/char/tpm/tpm.c +11 −24 Original line number Diff line number Diff line Loading @@ -162,7 +162,8 @@ ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr, < READ_PCR_RESULT_SIZE){ dev_dbg(chip->dev, "A TPM error (%d) occurred" " attempting to read PCR %d of %d\n", be32_to_cpu(*((__be32 *) (data + 6))), i, num_pcrs); be32_to_cpu(*((__be32 *) (data + 6))), i, num_pcrs); goto out; } str += sprintf(str, "PCR-%02d: ", i); Loading Loading @@ -194,12 +195,11 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr, if (chip == NULL) return -ENODEV; data = kmalloc(READ_PUBEK_RESULT_SIZE, GFP_KERNEL); data = kzalloc(READ_PUBEK_RESULT_SIZE, GFP_KERNEL); if (!data) return -ENOMEM; memcpy(data, readpubek, sizeof(readpubek)); memset(data + sizeof(readpubek), 0, 20); /* zero nonce */ if ((len = tpm_transmit(chip, data, READ_PUBEK_RESULT_SIZE)) < READ_PUBEK_RESULT_SIZE) { Loading Loading @@ -243,7 +243,6 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr, kfree(data); return rc; } EXPORT_SYMBOL_GPL(tpm_show_pubek); #define CAP_VER_RESULT_SIZE 18 Loading Loading @@ -312,7 +311,6 @@ ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr, } EXPORT_SYMBOL_GPL(tpm_store_cancel); /* * Device file system interface to the TPM */ Loading @@ -336,8 +334,7 @@ int tpm_open(struct inode *inode, struct file *file) } if (chip->num_opens) { dev_dbg(chip->dev, "Another process owns this TPM\n"); dev_dbg(chip->dev, "Another process owns this TPM\n"); rc = -EBUSY; goto err_out; } Loading @@ -363,7 +360,6 @@ int tpm_open(struct inode *inode, struct file *file) spin_unlock(&driver_lock); return rc; } EXPORT_SYMBOL_GPL(tpm_open); int tpm_release(struct inode *inode, struct file *file) Loading @@ -380,7 +376,6 @@ int tpm_release(struct inode *inode, struct file *file) spin_unlock(&driver_lock); return 0; } EXPORT_SYMBOL_GPL(tpm_release); ssize_t tpm_write(struct file *file, const char __user *buf, Loading Loading @@ -441,7 +436,6 @@ ssize_t tpm_read(struct file * file, char __user * buf, return ret_size; } EXPORT_SYMBOL_GPL(tpm_read); void tpm_remove_hardware(struct device *dev) Loading @@ -465,13 +459,13 @@ void tpm_remove_hardware(struct device *dev) sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= !(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= !(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); kfree(chip); put_device(dev); } EXPORT_SYMBOL_GPL(tpm_remove_hardware); static u8 savestate[] = { Loading @@ -493,7 +487,6 @@ int tpm_pm_suspend(struct device *dev, pm_message_t pm_state) tpm_transmit(chip, savestate, sizeof(savestate)); return 0; } EXPORT_SYMBOL_GPL(tpm_pm_suspend); /* Loading @@ -509,7 +502,6 @@ int tpm_pm_resume(struct device *dev) return 0; } EXPORT_SYMBOL_GPL(tpm_pm_resume); /* Loading @@ -519,8 +511,7 @@ EXPORT_SYMBOL_GPL(tpm_pm_resume); * upon errant exit from this function specific probe function should call * pci_disable_device */ int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry) int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry) { #define DEVNAME_SIZE 7 Loading @@ -529,12 +520,10 @@ int tpm_register_hardware(struct device *dev, int i, j; /* Driver specific per-device data */ chip = kmalloc(sizeof(*chip), GFP_KERNEL); chip = kzalloc(sizeof(*chip), GFP_KERNEL); if (chip == NULL) return -ENOMEM; memset(chip, 0, sizeof(struct tpm_chip)); init_MUTEX(&chip->buffer_mutex); init_MUTEX(&chip->tpm_mutex); INIT_LIST_HEAD(&chip->list); Loading @@ -558,8 +547,7 @@ int tpm_register_hardware(struct device *dev, dev_num_search_complete: if (chip->dev_num < 0) { dev_err(dev, "No available tpm device numbers\n"); dev_err(dev, "No available tpm device numbers\n"); kfree(chip); return -ENODEV; } else if (chip->dev_num == 0) Loading Loading @@ -597,7 +585,6 @@ int tpm_register_hardware(struct device *dev, return 0; } EXPORT_SYMBOL_GPL(tpm_register_hardware); MODULE_AUTHOR("Leendert van Doorn (leendert@watson.ibm.com)"); Loading drivers/char/tpm/tpm_atmel.c +8 −9 Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ static struct tpm_vendor_specific tpm_atmel = { .miscdev = { .fops = &atmel_ops, }, }; static struct platform_device *pdev = NULL; static struct platform_device *pdev; static void __devexit tpm_atml_remove(struct device *dev) { Loading Loading @@ -201,12 +201,10 @@ static int __init init_atmel(void) (tpm_read_index(TPM_ADDR, 0x01) != 0x01 )) return -ENODEV; pdev = kmalloc(sizeof(struct platform_device), GFP_KERNEL); pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL); if ( !pdev ) return -ENOMEM; memset(pdev, 0, sizeof(struct platform_device)); pdev->name = "tpm_atmel0"; pdev->id = -1; pdev->num_resources = 0; Loading Loading @@ -234,7 +232,8 @@ static int __init init_atmel(void) return rc; } dev_info(&pdev->dev, "Atmel TPM 1.1, Base Address: 0x%x\n", tpm_atmel.base); dev_info(&pdev->dev, "Atmel TPM 1.1, Base Address: 0x%x\n", tpm_atmel.base); return 0; } Loading drivers/char/tpm/tpm_infineon.c +4 −4 Original line number Diff line number Diff line Loading @@ -30,10 +30,10 @@ #define TPM_INFINEON_DEV_VEN_VALUE 0x15D1 /* These values will be filled after PnP-call */ static int TPM_INF_DATA = 0; static int TPM_INF_ADDR = 0; static int TPM_INF_BASE = 0; static int TPM_INF_PORT_LEN = 0; static int TPM_INF_DATA; static int TPM_INF_ADDR; static int TPM_INF_BASE; static int TPM_INF_PORT_LEN; /* TPM header definitions */ enum infineon_tpm_header { Loading Loading
drivers/char/tpm/tpm.c +11 −24 Original line number Diff line number Diff line Loading @@ -162,7 +162,8 @@ ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr, < READ_PCR_RESULT_SIZE){ dev_dbg(chip->dev, "A TPM error (%d) occurred" " attempting to read PCR %d of %d\n", be32_to_cpu(*((__be32 *) (data + 6))), i, num_pcrs); be32_to_cpu(*((__be32 *) (data + 6))), i, num_pcrs); goto out; } str += sprintf(str, "PCR-%02d: ", i); Loading Loading @@ -194,12 +195,11 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr, if (chip == NULL) return -ENODEV; data = kmalloc(READ_PUBEK_RESULT_SIZE, GFP_KERNEL); data = kzalloc(READ_PUBEK_RESULT_SIZE, GFP_KERNEL); if (!data) return -ENOMEM; memcpy(data, readpubek, sizeof(readpubek)); memset(data + sizeof(readpubek), 0, 20); /* zero nonce */ if ((len = tpm_transmit(chip, data, READ_PUBEK_RESULT_SIZE)) < READ_PUBEK_RESULT_SIZE) { Loading Loading @@ -243,7 +243,6 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr, kfree(data); return rc; } EXPORT_SYMBOL_GPL(tpm_show_pubek); #define CAP_VER_RESULT_SIZE 18 Loading Loading @@ -312,7 +311,6 @@ ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr, } EXPORT_SYMBOL_GPL(tpm_store_cancel); /* * Device file system interface to the TPM */ Loading @@ -336,8 +334,7 @@ int tpm_open(struct inode *inode, struct file *file) } if (chip->num_opens) { dev_dbg(chip->dev, "Another process owns this TPM\n"); dev_dbg(chip->dev, "Another process owns this TPM\n"); rc = -EBUSY; goto err_out; } Loading @@ -363,7 +360,6 @@ int tpm_open(struct inode *inode, struct file *file) spin_unlock(&driver_lock); return rc; } EXPORT_SYMBOL_GPL(tpm_open); int tpm_release(struct inode *inode, struct file *file) Loading @@ -380,7 +376,6 @@ int tpm_release(struct inode *inode, struct file *file) spin_unlock(&driver_lock); return 0; } EXPORT_SYMBOL_GPL(tpm_release); ssize_t tpm_write(struct file *file, const char __user *buf, Loading Loading @@ -441,7 +436,6 @@ ssize_t tpm_read(struct file * file, char __user * buf, return ret_size; } EXPORT_SYMBOL_GPL(tpm_read); void tpm_remove_hardware(struct device *dev) Loading @@ -465,13 +459,13 @@ void tpm_remove_hardware(struct device *dev) sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= !(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= !(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); kfree(chip); put_device(dev); } EXPORT_SYMBOL_GPL(tpm_remove_hardware); static u8 savestate[] = { Loading @@ -493,7 +487,6 @@ int tpm_pm_suspend(struct device *dev, pm_message_t pm_state) tpm_transmit(chip, savestate, sizeof(savestate)); return 0; } EXPORT_SYMBOL_GPL(tpm_pm_suspend); /* Loading @@ -509,7 +502,6 @@ int tpm_pm_resume(struct device *dev) return 0; } EXPORT_SYMBOL_GPL(tpm_pm_resume); /* Loading @@ -519,8 +511,7 @@ EXPORT_SYMBOL_GPL(tpm_pm_resume); * upon errant exit from this function specific probe function should call * pci_disable_device */ int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry) int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry) { #define DEVNAME_SIZE 7 Loading @@ -529,12 +520,10 @@ int tpm_register_hardware(struct device *dev, int i, j; /* Driver specific per-device data */ chip = kmalloc(sizeof(*chip), GFP_KERNEL); chip = kzalloc(sizeof(*chip), GFP_KERNEL); if (chip == NULL) return -ENOMEM; memset(chip, 0, sizeof(struct tpm_chip)); init_MUTEX(&chip->buffer_mutex); init_MUTEX(&chip->tpm_mutex); INIT_LIST_HEAD(&chip->list); Loading @@ -558,8 +547,7 @@ int tpm_register_hardware(struct device *dev, dev_num_search_complete: if (chip->dev_num < 0) { dev_err(dev, "No available tpm device numbers\n"); dev_err(dev, "No available tpm device numbers\n"); kfree(chip); return -ENODEV; } else if (chip->dev_num == 0) Loading Loading @@ -597,7 +585,6 @@ int tpm_register_hardware(struct device *dev, return 0; } EXPORT_SYMBOL_GPL(tpm_register_hardware); MODULE_AUTHOR("Leendert van Doorn (leendert@watson.ibm.com)"); Loading
drivers/char/tpm/tpm_atmel.c +8 −9 Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ static struct tpm_vendor_specific tpm_atmel = { .miscdev = { .fops = &atmel_ops, }, }; static struct platform_device *pdev = NULL; static struct platform_device *pdev; static void __devexit tpm_atml_remove(struct device *dev) { Loading Loading @@ -201,12 +201,10 @@ static int __init init_atmel(void) (tpm_read_index(TPM_ADDR, 0x01) != 0x01 )) return -ENODEV; pdev = kmalloc(sizeof(struct platform_device), GFP_KERNEL); pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL); if ( !pdev ) return -ENOMEM; memset(pdev, 0, sizeof(struct platform_device)); pdev->name = "tpm_atmel0"; pdev->id = -1; pdev->num_resources = 0; Loading Loading @@ -234,7 +232,8 @@ static int __init init_atmel(void) return rc; } dev_info(&pdev->dev, "Atmel TPM 1.1, Base Address: 0x%x\n", tpm_atmel.base); dev_info(&pdev->dev, "Atmel TPM 1.1, Base Address: 0x%x\n", tpm_atmel.base); return 0; } Loading
drivers/char/tpm/tpm_infineon.c +4 −4 Original line number Diff line number Diff line Loading @@ -30,10 +30,10 @@ #define TPM_INFINEON_DEV_VEN_VALUE 0x15D1 /* These values will be filled after PnP-call */ static int TPM_INF_DATA = 0; static int TPM_INF_ADDR = 0; static int TPM_INF_BASE = 0; static int TPM_INF_PORT_LEN = 0; static int TPM_INF_DATA; static int TPM_INF_ADDR; static int TPM_INF_BASE; static int TPM_INF_PORT_LEN; /* TPM header definitions */ enum infineon_tpm_header { Loading