Fix NULL dereference in gfn_to_hva_prot()
authorGleb Natapov <gleb@redhat.com>
Tue, 1 Oct 2013 16:58:36 +0000 (19:58 +0300)
committerGleb Natapov <gleb@redhat.com>
Thu, 3 Oct 2013 07:08:52 +0000 (10:08 +0300)
commita2ac07fe292ea41296049dfdbfeed203e2467ee7
tree93f6f81ef917245073ffdbc89123dd74cd8ccdd4
parent517bf8fc211d37d3aa005fb35f9ee7f1d35cb860
Fix NULL dereference in gfn_to_hva_prot()

gfn_to_memslot() can return NULL or invalid slot. We need to check slot
validity before accessing it.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
virt/kvm/kvm_main.c