Skip to contentSkip to conversation

crypto: ccp: Do not free psp_master when PLATFORM_INIT fails

PATCH In review Singh, Brijesh 2 participants 2 messages Apr 8, 2019 – Apr 18, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 200664d5237f ("crypto: ccp: Add SEV support")
Cc Tom Lendacky <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Gary Hook <[email protected]>
Cc [email protected] # 4.19.y
---
 drivers/crypto/ccp/psp-dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/ccp/psp-dev.c +1 -1
index 80a59be9c80d..656838433f2f 100644
@@ -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,
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 12 lines · Brijesh

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 <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Gary Hook <[email protected]>
Cc [email protected] # 4.19.y
Quoted 3 lines
---
 drivers/crypto/ccp/psp-dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt