Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54714
b: refs/heads/master
c: 8e39c93
h: refs/heads/master
v: v3
  • Loading branch information
Parag Warudkar authored and Linus Torvalds committed May 8, 2007
1 parent 481b5c1 commit 55d2972
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53ab97a1c1536015d4d6d900363ea96fece5ed97
refs/heads/master: 8e39c933b1b7df501dbb68879fb1640e277b8a5c
12 changes: 8 additions & 4 deletions trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,12 +942,12 @@ int tpm_release(struct inode *inode, struct file *file)
{
struct tpm_chip *chip = file->private_data;

flush_scheduled_work();
spin_lock(&driver_lock);
file->private_data = NULL;
chip->num_opens--;
del_singleshot_timer_sync(&chip->user_read_timer);
flush_scheduled_work();
atomic_set(&chip->data_pending, 0);
chip->num_opens--;
put_device(chip->dev);
kfree(chip->data_buffer);
spin_unlock(&driver_lock);
Expand Down Expand Up @@ -1097,8 +1097,13 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vend

/* Driver specific per-device data */
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL);

if (chip == NULL || devname == NULL) {
kfree(chip);
kfree(devname);
return NULL;
}

init_MUTEX(&chip->buffer_mutex);
init_MUTEX(&chip->tpm_mutex);
Expand All @@ -1124,7 +1129,6 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vend

set_bit(chip->dev_num, dev_mask);

devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL);
scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num);
chip->vendor.miscdev.name = devname;

Expand Down

0 comments on commit 55d2972

Please sign in to comment.