crypto: ccp - Do not free psp_master when PLATFORM_INIT fails
authorSingh, Brijesh <brijesh.singh@amd.com>
Mon, 8 Apr 2019 20:42:55 +0000 (20:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2019 05:37:36 +0000 (07:37 +0200)
commit07d677ae4db4fd48f55d75e9ec3b7527b18aacbe
treea97bd58fdb37381f6bf8f9d7a27e7059790e82b0
parentfe632ee5ade8290119b7ea82350c4695817fb9d6
crypto: ccp - Do not free psp_master when PLATFORM_INIT fails

commit f5a2aeb8b254c764772729a6e48d4e0c914bb56a upstream.

Currently, we free the psp_master if the PLATFORM_INIT fails during the
SEV FW probe. If psp_master is freed then driver does not invoke the PSP
FW. As per SEV FW spec, there are several commands (PLATFORM_RESET,
PLATFORM_STATUS, GET_ID etc) which can be executed in the UNINIT state
We should not free the psp_master when PLATFORM_INIT fails.

Fixes: 200664d5237f ("crypto: ccp: Add SEV support")
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Gary Hook <gary.hook@amd.com>
Cc: stable@vger.kernel.org # 4.19.y
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccp/psp-dev.c