mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
tpm: Properly clean sysfs entries in error path
Properly clean the sysfs entries in the error path Cc: <stable@vger.kernel.org> Reported-by: Dmitry Kasatkin <dmitry.kasatkin@gmail.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
This commit is contained in:
parent
f07a5e9a33
commit
b49e1043c4
1 changed files with 3 additions and 1 deletions
|
@ -1095,7 +1095,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
|
|||
goto del_misc;
|
||||
|
||||
if (tpm_add_ppi(&dev->kobj))
|
||||
goto del_misc;
|
||||
goto del_sysfs;
|
||||
|
||||
chip->bios_dir = tpm_bios_log_setup(chip->devname);
|
||||
|
||||
|
@ -1106,6 +1106,8 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
|
|||
|
||||
return chip;
|
||||
|
||||
del_sysfs:
|
||||
tpm_sysfs_del_device(chip);
|
||||
del_misc:
|
||||
tpm_dev_del_device(chip);
|
||||
put_device:
|
||||
|
|
Loading…
Reference in a new issue