diff options
author | Nicholas Krause <xerofoify@gmail.com> | 2015-12-30 13:08:46 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-01-07 08:51:32 -0500 |
commit | 1dab1345d885819a3a0d5d08ce0b5c2e12c65343 (patch) | |
tree | b6e8d7aabaca0e4d215534a723aef18557f73eec | |
parent | 0af2593b2ad125880a78d1bba966e450cc2330df (diff) |
kvm: x86: Check kvm_write_guest return value in kvm_write_wall_clock
This makes sure the wall clock is updated only after an odd version value
is successfully written to guest memory.
Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/x86/kvm/x86.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index b6102c1eb3b1..102c3028513f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1169,7 +1169,8 @@ static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock) | |||
1169 | 1169 | ||
1170 | ++version; | 1170 | ++version; |
1171 | 1171 | ||
1172 | kvm_write_guest(kvm, wall_clock, &version, sizeof(version)); | 1172 | if (kvm_write_guest(kvm, wall_clock, &version, sizeof(version))) |
1173 | return; | ||
1173 | 1174 | ||
1174 | /* | 1175 | /* |
1175 | * The guest calculates current wall clock time by adding | 1176 | * The guest calculates current wall clock time by adding |