[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210816192312.1291783-1-trix@redhat.com>
Date: Mon, 16 Aug 2021 12:23:12 -0700
From: trix@...hat.com
To: brijesh.singh@....com, thomas.lendacky@....com, john.allen@....com,
herbert@...dor.apana.org.au, davem@...emloft.net,
ashish.kalra@....com, rientjes@...gle.com
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
Tom Rix <trix@...hat.com>
Subject: [PATCH] crypto: initialize error variable
From: Tom Rix <trix@...hat.com>
Static analysis reports this problem
sev-dev.c:1094:19: warning: The left operand of '==' is a garbage value
if (rc && (error == SEV_RET_SECURE_DATA_INVALID)) {
~~~~~ ^
The error variable may not be set by the call to
sev_platform_init(). So initialize error to SEV_RET_SUCCESS.
Fixes: 1d55fdc85799 ("crypto: ccp - Retry SEV INIT command in case of integrity check failure.")
Signed-off-by: Tom Rix <trix@...hat.com>
---
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 2ecb0e1f65d8d..b2b9f0f4daf2d 100644
--- a/drivers/crypto/ccp/sev-dev.c
+++ b/drivers/crypto/ccp/sev-dev.c
@@ -1065,7 +1065,7 @@ void sev_pci_init(void)
{
struct sev_device *sev = psp_master->sev_data;
struct page *tmr_page;
- int error, rc;
+ int error = SEV_RET_SUCCESS, rc;
if (!sev)
return;
--
2.26.3
Powered by blists - more mailing lists