Skip to content

Commit b49e104

Browse files
stefanbergerPeterHuewe
authored andcommitted
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>
1 parent f07a5e9 commit b49e104

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/char/tpm/tpm-interface.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
10951095
goto del_misc;
10961096

10971097
if (tpm_add_ppi(&dev->kobj))
1098-
goto del_misc;
1098+
goto del_sysfs;
10991099

11001100
chip->bios_dir = tpm_bios_log_setup(chip->devname);
11011101

@@ -1106,6 +1106,8 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
11061106

11071107
return chip;
11081108

1109+
del_sysfs:
1110+
tpm_sysfs_del_device(chip);
11091111
del_misc:
11101112
tpm_dev_del_device(chip);
11111113
put_device:

0 commit comments

Comments
 (0)