Commit f5a2aeb8 authored by Singh, Brijesh's avatar Singh, Brijesh Committed by Herbert Xu

crypto: ccp - Do not free psp_master when PLATFORM_INIT fails

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: 200664d5 ("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: default avatarBrijesh Singh <brijesh.singh@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent a88be9a7
...@@ -1064,7 +1064,7 @@ void psp_pci_init(void) ...@@ -1064,7 +1064,7 @@ void psp_pci_init(void)
rc = sev_platform_init(&error); rc = sev_platform_init(&error);
if (rc) { if (rc) {
dev_err(sp->dev, "SEV: failed to INIT error %#x\n", error); dev_err(sp->dev, "SEV: failed to INIT error %#x\n", error);
goto err; return;
} }
dev_info(sp->dev, "SEV API:%d.%d build:%d\n", psp_master->api_major, dev_info(sp->dev, "SEV API:%d.%d build:%d\n", psp_master->api_major,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment