[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211205194719.16987-1-amhamza.mgc@gmail.com>
Date: Mon, 6 Dec 2021 00:47:19 +0500
From: Ameer Hamza <amhamza.mgc@...il.com>
To: pbonzini@...hat.com, seanjc@...gle.com, vkuznets@...hat.com,
wanpengli@...cent.com, jmattson@...gle.com, joro@...tes.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
amhamza.mgc@...il.com
Subject: [PATCH] KVM: x86: fix for missing initialization of return status variable
If undefined ioctl number is passed to the kvm_vcpu_ioctl_device_attr
function, it should return with error status.
Addresses-Coverity: 1494124 ("Uninitialized scalar variable")
Signed-off-by: Ameer Hamza <amhamza.mgc@...il.com>
---
arch/x86/kvm/x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index e0aa4dd53c7f..55b90c185717 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5001,7 +5001,7 @@ static int kvm_vcpu_ioctl_device_attr(struct kvm_vcpu *vcpu,
void __user *argp)
{
struct kvm_device_attr attr;
- int r;
+ int r = -EINVAL;
if (copy_from_user(&attr, argp, sizeof(attr)))
return -EFAULT;
--
2.25.1
Powered by blists - more mailing lists