KVM: SVM: Fix "error" isn't initialized
Subsystems (5)
PATCH v2 1/1 KVM: SVM: Fix "error" isn't initialized
From e7f9c786e43ef4f890b8a01f15f8f00786f4b14a Mon Sep 17 00:00:00 2001
From: Haiwei Li <[email protected]>
Date: Wed, 27 Nov 2019 15:00:49 +0800
Subject: [PATCH v2] fix: 'error' is not initialized
There are a bunch of error paths were "error" isn't initialized.
--- arch/x86/kvm/svm.c | 3 ++- drivers/crypto/ccp/psp-dev.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-)
arch/x86/kvm/svm.c +2 -1
@@ -6308,7 +6308,8 @@ static int sev_flush_asids(void)up_write (&sev_deactivate_lock);if (ret) -pr_err ("SEV: DF_FLUSH failed, ret=%d, error=%#x\n" , ret, error); +pr_err ("SEV: DF_FLUSH failed, ret=%d. PSP returned error=%#x\n" , + ret, error);return ret; }
drivers/crypto/ccp/psp-dev.c +2 -0
@@ -155,6 +155,8 @@ static int __sev_do_cmd_locked(int cmd, void *data, int *psp_ret)unsigned int phys_lsb, phys_msb;unsigned int reg, ret =0 ; + *psp_ret =-1 ; +if (!psp)return -ENODEV ;
--
1.8.3.1
Quoted 23 lines · Haiwei Li
From
e7f9c786e43ef4f890b8a01f15f8f00786f4b14aMon Sep 17 00:00:00 2001
From: Haiwei Li <[email protected]>
Date: Wed, 27 Nov 2019 15:00:49 +0800
Subject: [PATCH v2] fix: 'error' is not initializedThere are a bunch of error paths were "error" isn't initialized.
Signed-off-by Haiwei Li <[email protected]>Reported-by Dan Carpenter <[email protected]>---
arch/x86/kvm/svm.c| 3 ++-drivers/crypto/ccp/psp-dev.c| 2 ++2 files changed, 4 insertions(+), 1 deletion(-)arch/x86/kvm/svm.c +0
-0
arch/x86/kvm/svm.c static int sev_flush_asids(void) · line 6312
Quoted 6 lines
arch/x86/kvm/svm.c +2
-1@@ -6308,7 +6308,8 @@ static int sev_flush_asids(void)up_write (&sev_deactivate_lock);if (ret) -pr_err ("SEV: DF_FLUSH failed, ret=%d, error=%#x\n" , ret, error); +pr_err ("SEV: DF_FLUSH failed, ret=%d. PSP returned error=%#x\n" , + ret, error);
This specific text change does not seem to match the patch description.
Quoted 18 lines
arch/x86/kvm/svm.c +0
-0return ret; }drivers/crypto/ccp/psp-dev.c +2
-1@@ -155,6 +155,8 @@ static int __sev_do_cmd_locked(int cmd, void *data, int *psp_ret)unsigned int phys_lsb, phys_msb;unsigned int reg, ret =0 ; + *psp_ret =-1 ; +if (!psp)return -ENODEV ; --1.8.3.1
Tom Lendacky
maintainerQuoted 6 lines · Haiwei Li
From
e7f9c786e43ef4f890b8a01f15f8f00786f4b14aMon Sep 17 00:00:00 2001
From: Haiwei Li <[email protected]>
Date: Wed, 27 Nov 2019 15:00:49 +0800
Subject: [PATCH v2] fix: 'error' is not initializedThere are a bunch of error paths were "error" isn't initialized.
Please provide a better patch commit message and just fix the actual problem, which is error is uninitialized in sev_flush_asids(). Please just initialize error to zero.
Thanks,
Tom
Quoted 38 lines
Signed-off-by Haiwei Li <[email protected]>Reported-by Dan Carpenter <[email protected]>--- arch/x86/kvm/svm.c | 3 ++- drivers/crypto/ccp/psp-dev.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-)arch/x86/kvm/svm.c +2
-1@@ -6308,7 +6308,8 @@ static int sev_flush_asids(void) up_write(&sev_deactivate_lock); if (ret) - pr_err("SEV: DF_FLUSH failed, ret=%d, error=%#x\n", ret, error); + pr_err("SEV: DF_FLUSH failed, ret=%d. PSP returned error=%#x\n", + ret, error); return ret; }drivers/crypto/ccp/psp-dev.c +2
-0@@ -155,6 +155,8 @@ static int __sev_do_cmd_locked(int cmd, void *data, int *psp_ret) unsigned int phys_lsb, phys_msb; unsigned int reg, ret = 0; + *psp_ret = -1; + if (!psp) return -ENODEV;Signature · 2 lines
-- 1.8.3.1