OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Nov 2018 15:41:36 +0000 (07:41 -0800)
commitc447410b6dfacf132865e79af7bc26fa977f24e5
treed812e14cd4def97e8d4908bc1b14023e9b9e2791
parentc8a5f83fa43e8464f7bef12a8dc22f4e778bd78b
tpm: fix: return rc when devm_add_action() fails

[ Upstream commit 4f3b193dee4423d8c89c9a3e8e05f9197ea459a4 ]

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")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/tpm/tpm-chip.c