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)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 18 Apr 2019 14:14:58 +0000 (22:14 +0800)
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>
drivers/crypto/ccp/psp-dev.c

index 80a59be9c80dfebdaf6a92704f7fbbb78b12722d..656838433f2f92e79e942428373aabab77920223 100644 (file)
@@ -1064,7 +1064,7 @@ void psp_pci_init(void)
        rc = sev_platform_init(&error);
        if (rc) {
                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,