• Dmitry Vyukov's avatar
    kvm: fix usage of uninit spinlock in avic_vm_destroy() · 3863dff0
    Dmitry Vyukov authored
    
    
    If avic is not enabled, avic_vm_init() does nothing and returns early.
    However, avic_vm_destroy() still tries to destroy what hasn't been created.
    The only bad consequence of this now is that avic_vm_destroy() uses
    svm_vm_data_hash_lock that hasn't been initialized (and is not meant
    to be used at all if avic is not enabled).
    
    Return early from avic_vm_destroy() if avic is not enabled.
    It has nothing to destroy.
    Signed-off-by: default avatarDmitry Vyukov <dvyukov@google.com>
    Cc: Joerg Roedel <joro@8bytes.org>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: "Radim Krčmář" <rkrcmar@redhat.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: kvm@vger.kernel.org
    Cc: syzkaller@googlegroups.com
    Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
    Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
    3863dff0