Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114913
b: refs/heads/master
c: dd78c94
h: refs/heads/master
i:
  114911: b46d36d
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Oct 16, 2008
1 parent ae7e97d commit 0564157
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 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: 63a10dfdda0e2262f5b61b54b6d9b1747a87ff54
refs/heads/master: dd78c9439fc1e031835bccb934d27b978c72c536
15 changes: 8 additions & 7 deletions trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1187,11 +1187,8 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL);

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

mutex_init(&chip->buffer_mutex);
mutex_init(&chip->tpm_mutex);
Expand All @@ -1208,8 +1205,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,

if (chip->dev_num >= TPM_NUM_DEVICES) {
dev_err(dev, "No available tpm device numbers\n");
kfree(chip);
return NULL;
goto out_free;
} else if (chip->dev_num == 0)
chip->vendor.miscdev.minor = TPM_MINOR;
else
Expand Down Expand Up @@ -1250,6 +1246,11 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
spin_unlock(&driver_lock);

return chip;

out_free:
kfree(chip);
kfree(devname);
return NULL;
}
EXPORT_SYMBOL_GPL(tpm_register_hardware);

Expand Down

0 comments on commit 0564157

Please sign in to comment.