Skip to content

Commit

Permalink
tpm: Properly clean sysfs entries in error path
Browse files Browse the repository at this point in the history
Properly clean the sysfs entries in the error path

Cc: <[email protected]>
Reported-by: Dmitry Kasatkin <[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Peter Huewe <[email protected]>
  • Loading branch information
stefanberger authored and PeterHuewe committed Jul 29, 2014
1 parent f07a5e9 commit b49e104
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/char/tpm/tpm-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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:
Expand Down

0 comments on commit b49e104

Please sign in to comment.