KVM: x86: fix *NULL on invalid low-prio irq
authorRadim Krčmář <rkrcmar@redhat.com>
Fri, 12 Feb 2016 14:00:15 +0000 (15:00 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Feb 2016 17:48:36 +0000 (18:48 +0100)
commit4efd805fca5590af181f89ad122b8695c63b5f2c
treefb46888644286c0394f2dd04b1765698df7b032a
parent78db6a5037965429c04d708281f35a6e5562d31b
KVM: x86: fix *NULL on invalid low-prio irq

Smatch noticed a NULL dereference in kvm_intr_is_single_vcpu_fast that
happens if VM already warned about invalid lowest-priority interrupt.

Create a function for common code while fixing it.

Fixes: 6228a0da8057 ("KVM: x86: Add lowest-priority support for vt-d posted-interrupts")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c