qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-arm: Fix incorrect check of kvm_vcpu_ioctl return value
@ 2013-04-23 15:58 Peter Maydell
  0 siblings, 0 replies; only message in thread
From: Peter Maydell @ 2013-04-23 15:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

kvm_vcpu_ioctl() returns -ETHING on error, not ETHING -- correct
an incorrect check in kvm_arch_init_vcpu(). This would not have
had any significant ill-effects -- we would just have propagated
the less useful ENOENT up to the caller rather than the more
accurate EINVAL in the unlikely case that the kernel didn't
have VFP-D32 support.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Pretty trivial bugfix, noticed while I was doing something to
the code in this area...

 target-arm/kvm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target-arm/kvm.c b/target-arm/kvm.c
index d8acace..b7bdc03 100644
--- a/target-arm/kvm.c
+++ b/target-arm/kvm.c
@@ -62,8 +62,8 @@ int kvm_arch_init_vcpu(CPUState *cs)
     r.id = KVM_REG_ARM | KVM_REG_SIZE_U64 | KVM_REG_ARM_VFP | 31;
     r.addr = (uintptr_t)(&v);
     ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &r);
-    if (ret == ENOENT) {
-        return EINVAL;
+    if (ret == -ENOENT) {
+        return -EINVAL;
     }
     return ret;
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-23 15:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-23 15:58 [Qemu-devel] [PATCH] target-arm: Fix incorrect check of kvm_vcpu_ioctl return value Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).