Skip to content

Commit dd7ffbb

Browse files
stefanbergergregkh
authored andcommitted
tpm: Properly clean sysfs entries in error path
commit b49e104 upstream. Properly clean the sysfs entries in the error path 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1cd6eca commit dd7ffbb

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
@@ -1116,7 +1116,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
11161116
goto del_misc;
11171117

11181118
if (tpm_add_ppi(&dev->kobj))
1119-
goto del_misc;
1119+
goto del_sysfs;
11201120

11211121
chip->bios_dir = tpm_bios_log_setup(chip->devname);
11221122

@@ -1127,6 +1127,8 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
11271127

11281128
return chip;
11291129

1130+
del_sysfs:
1131+
tpm_sysfs_del_device(chip);
11301132
del_misc:
11311133
tpm_dev_del_device(chip);
11321134
put_device:

0 commit comments

Comments
 (0)