[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220110211837.1442964-1-pgonda@google.com>
Date: Mon, 10 Jan 2022 13:18:37 -0800
From: Peter Gonda <pgonda@...gle.com>
To: linux-kernel@...r.kernel.org
Cc: Peter Gonda <pgonda@...gle.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Tom Lendacky <thomas.lendacky@....com>,
Brijesh Singh <brijesh.singh@....com>,
Marc Orr <marcorr@...gle.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
John Allen <john.allen@....com>,
"David S. Miller" <davem@...emloft.net>,
linux-crypto@...r.kernel.org
Subject: [PATCH] crypto: ccp - Ensure psp_ret is always init'd in __sev_platform_init_locked()
Initialize psp_ret inside of __sev_platform_init_locked() because there
are many failure paths with PSP initialization that do not set
__sev_do_cmd_locked().
Fixes: e423b9d75e77: ("crypto: ccp - Move SEV_INIT retry for corrupted data")
Signed-off-by: Peter Gonda <pgonda@...gle.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Tom Lendacky <thomas.lendacky@....com>
Cc: Brijesh Singh <brijesh.singh@....com>
Cc: Marc Orr <marcorr@...gle.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>
Cc: John Allen <john.allen@....com>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: linux-crypto@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
drivers/crypto/ccp/sev-dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c
index 8fd774a10edc..6ab93dfd478a 100644
--- a/drivers/crypto/ccp/sev-dev.c
+++ b/drivers/crypto/ccp/sev-dev.c
@@ -413,7 +413,7 @@ static int __sev_platform_init_locked(int *error)
{
struct psp_device *psp = psp_master;
struct sev_device *sev;
- int rc, psp_ret;
+ int rc, psp_ret = -1;
int (*init_function)(int *error);
if (!psp || !psp->sev_data)
--
2.34.1.575.g55b058a8bb-goog
Powered by blists - more mailing lists