From: Jan Kiszka Date: Tue, 3 Nov 2009 11:49:05 +0000 (+0100) Subject: KVM: x86: Fix KVM_GET_CLOCK X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e3f2cf5e6a31d193fb5c27b9b985e5573da39eef;p=users%2Fdwmw2%2Flinux.git KVM: x86: Fix KVM_GET_CLOCK 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 Signed-off-by: Marcelo Tosatti --- diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 1cc51ca9adb0e..cd6fe0a5797fb 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -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; }