diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-07-07 16:49:00 +0300 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-07-10 13:28:46 +0300 |
commit | 7e988b103d0d52190244517edc76e649071284bb (patch) | |
tree | bf77f5167fd34482b7b77b0aa51a93dee1b1c5d5 | |
parent | a80cf7b5f4149753d5f19c872a47e66195b167d4 (diff) | |
download | linux-7e988b103d0d52190244517edc76e649071284bb.tar.xz |
KVM: use correct accessor function for __kvm_memslots
kvm memslots are protected by srcu and not by rcu. We must use
srcu_dereference_check instead of rcu_dereference_check.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | include/linux/kvm_host.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b3ca77a96b2d..648b34cabb38 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -568,9 +568,8 @@ void kvm_put_kvm(struct kvm *kvm); static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int as_id) { - return rcu_dereference_check(kvm->memslots[as_id], - srcu_read_lock_held(&kvm->srcu) - || lockdep_is_held(&kvm->slots_lock)); + return srcu_dereference_check(kvm->memslots[as_id], &kvm->srcu, + lockdep_is_held(&kvm->slots_lock)); } static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) |