Thread (160 messages) 160 messages, 4 authors, 2014-09-16
STALE4328d REVIEWED: 1 (0M)

[PATCH 3.16 023/158] tpm: Properly clean sysfs entries in error path

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2014-09-15 21:15:37
Also in: lkml

3.16-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Stefan Berger <redacted>

commit b49e1043c48dac23f64fba684d31c4a96c1ffaa0 upstream.

Properly clean the sysfs entries in the error path

Reported-by: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
Signed-off-by: Stefan Berger <redacted>
Reviewed-by: Jason Gunthorpe <redacted>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/char/tpm/tpm-interface.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -1116,7 +1116,7 @@ struct tpm_chip *tpm_register_hardware(s
 		goto del_misc;
 
 	if (tpm_add_ppi(&dev->kobj))
-		goto del_misc;
+		goto del_sysfs;
 
 	chip->bios_dir = tpm_bios_log_setup(chip->devname);
 
@@ -1127,6 +1127,8 @@ struct tpm_chip *tpm_register_hardware(s
 
 	return chip;
 
+del_sysfs:
+	tpm_sysfs_del_device(chip);
 del_misc:
 	tpm_dev_del_device(chip);
 put_device:

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help