[PATCH] tpm: fix error handling
- handle sysfs error - handle driver model errors - de-obfuscate platform_device_register_simple() call, which included an assignment in between two function calls, in the same C statement. Signed-off-by: Jeff Garzik <jeff@garzik.org> Acked-by: Kylene Hall <kjhall@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
5a2b4062f5
commit
f33d9bd504
@ -1153,7 +1153,14 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vend
|
||||
|
||||
spin_unlock(&driver_lock);
|
||||
|
||||
sysfs_create_group(&dev->kobj, chip->vendor.attr_group);
|
||||
if (sysfs_create_group(&dev->kobj, chip->vendor.attr_group)) {
|
||||
list_del(&chip->list);
|
||||
put_device(dev);
|
||||
clear_bit(chip->dev_num, dev_mask);
|
||||
kfree(chip);
|
||||
kfree(devname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
chip->bios_dir = tpm_bios_log_setup(devname);
|
||||
|
||||
|
Reference in New Issue
Block a user