diff options
author | Tom Zanussi <zanussi@kernel.org> | 2020-03-25 11:43:20 -0500 |
---|---|---|
committer | Tom Zanussi <zanussi@kernel.org> | 2020-03-25 11:43:20 -0500 |
commit | 138f9fdb00076ee650e3f55a730c1003d4e06f10 (patch) | |
tree | 1f2be26201de5765f55a2bf01950eedc8f977a95 /virt | |
parent | 5c41599ad817e04c88d08a46941fbeafdf778e3d (diff) | |
parent | 12cd844a39ed16aa183a820a54fe6f9a0bb4cd14 (diff) | |
download | linux-rt-138f9fdb00076ee650e3f55a730c1003d4e06f10.tar.gz |
Merge tag 'v4.14.173' into v4.14-rt-work
This is the 4.14.173 stable release
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 745ee09083dd..71f77ae6c2a6 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2027,12 +2027,12 @@ int kvm_write_guest_offset_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, if (slots->generation != ghc->generation) __kvm_gfn_to_hva_cache_init(slots, ghc, ghc->gpa, ghc->len); - if (unlikely(!ghc->memslot)) - return kvm_write_guest(kvm, gpa, data, len); - if (kvm_is_error_hva(ghc->hva)) return -EFAULT; + if (unlikely(!ghc->memslot)) + return kvm_write_guest(kvm, gpa, data, len); + r = __copy_to_user((void __user *)ghc->hva + offset, data, len); if (r) return -EFAULT; @@ -2060,12 +2060,12 @@ int kvm_read_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, if (slots->generation != ghc->generation) __kvm_gfn_to_hva_cache_init(slots, ghc, ghc->gpa, ghc->len); - if (unlikely(!ghc->memslot)) - return kvm_read_guest(kvm, ghc->gpa, data, len); - if (kvm_is_error_hva(ghc->hva)) return -EFAULT; + if (unlikely(!ghc->memslot)) + return kvm_read_guest(kvm, ghc->gpa, data, len); + r = __copy_from_user(data, (void __user *)ghc->hva, len); if (r) return -EFAULT; |