tpm: fix: return rc when devm_add_action() fails
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Sat, 13 Feb 2016 09:58:16 +0000 (11:58 +0200)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Sat, 20 Feb 2016 07:59:32 +0000 (09:59 +0200)
commit4f3b193dee4423d8c89c9a3e8e05f9197ea459a4
tree56561ff7da6f2fb42e868270e6988f7218f361d4
parentc0b5eed110dcf520aadafefbcc40658cbdd18b95
tpm: fix: return rc when devm_add_action() fails

Call put_device() and return error code if devm_add_action() fails.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Fixes: 8e0ee3c9faed ("tpm: fix the cleanup of struct tpm_chip")
drivers/char/tpm/tpm-chip.c