]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: x86: Fix KVM_GET_CLOCK
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 3 Nov 2009 11:49:05 +0000 (12:49 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 3 Nov 2009 13:15:39 +0000 (11:15 -0200)
The flags field of kvm_clock_data is supposed to indicate the
availability of additional fields one day. There are none yet, so clear
it. Moreover, drop the bogus check of this field and return 0 on
success.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/x86.c

index 1cc51ca9adb0ecd6cb1951c874a0167d61753f5f..cd6fe0a5797fb094e4e805b275d10f1869056e00 100644 (file)
@@ -2597,14 +2597,12 @@ long kvm_arch_vm_ioctl(struct file *filp,
                ktime_get_ts(&now);
                now_ns = timespec_to_ns(&now);
                user_ns.clock = kvm->arch.kvmclock_offset + now_ns;
+               user_ns.flags = 0;
 
+               r = -EFAULT;
                if (copy_to_user(argp, &user_ns, sizeof(user_ns)))
-                       r =  -EFAULT;
-
-               r = -EINVAL;
-               if (user_ns.flags)
                        goto out;
-
+               r = 0;
                break;
        }