From: Christian Borntraeger Date: Fri, 7 Jul 2017 13:49:00 +0000 (+0200) Subject: KVM: use correct accessor function for __kvm_memslots X-Git-Tag: v4.14-rc1~449^2~21^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e988b103d0d52190244517edc76e649071284bb;p=platform%2Fkernel%2Flinux-rpi.git 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 Suggested-by: Paolo Bonzini --- diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b3ca77a..648b34c 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)