Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3276
b: refs/heads/master
c: 6f9becc
h: refs/heads/master
v: v3
  • Loading branch information
Kylene Jo Hall authored and Linus Torvalds committed Jun 25, 2005
1 parent 4b2cc7f commit 636e05c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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: 1dda8abe6feb906306a627b170654ddd8addcdac
refs/heads/master: 6f9beccb95a47a15e446f64fbb7041dc6edce4d9
8 changes: 6 additions & 2 deletions trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ void __devexit tpm_remove(struct pci_dev *pci_dev)

pci_set_drvdata(pci_dev, NULL);
misc_deregister(&chip->vendor->miscdev);
kfree(&chip->vendor->miscdev.name);

sysfs_remove_group(&pci_dev->dev.kobj, chip->vendor->attr_group);

Expand Down Expand Up @@ -526,7 +527,9 @@ EXPORT_SYMBOL_GPL(tpm_pm_resume);
int tpm_register_hardware(struct pci_dev *pci_dev,
struct tpm_vendor_specific *entry)
{
char devname[7];
#define DEVNAME_SIZE 7

char *devname;
struct tpm_chip *chip;
int i, j;

Expand Down Expand Up @@ -569,7 +572,8 @@ int tpm_register_hardware(struct pci_dev *pci_dev,
else
chip->vendor->miscdev.minor = MISC_DYNAMIC_MINOR;

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

chip->vendor->miscdev.dev = &(pci_dev->dev);
Expand Down

0 comments on commit 636e05c

Please sign in to comment.