]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commitdiff
target-arm: Fix incorrect check of kvm_vcpu_ioctl return value
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 3 May 2013 17:47:22 +0000 (18:47 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 3 May 2013 17:47:22 +0000 (18:47 +0100)
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>
target-arm/kvm.c

index d8acace9b7f2cfb8321060073e7f398510251eac..b7bdc034fd9b18998106c50c28925f2a54ad2d83 100644 (file)
@@ -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;
 }