[ Upstream commit4f3b193dee] 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:8e0ee3c9fa("tpm: fix the cleanup of struct tpm_chip") Signed-off-by: Sasha Levin <sashal@kernel.org>