[RFC 3/5] pc: Don't crash on apic_accept_pic_intr() if CPU has no apic_state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



apic_accept_pic_intr() returns -1 if gets NULL as argument. So, instead
of checking if apic_accept_pic_intr() returns non-zero, check for return
value > 0.

Signed-off-by: Eduardo Habkost <ehabkost@xxxxxxxxxx>
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 14f0d91..c747615 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -197,7 +197,7 @@ static void pic_irq_request(void *opaque, int irq, int level)
     if (cpu->apic_state) {
         CPU_FOREACH(cs) {
             cpu = X86_CPU(cs);
-            if (apic_accept_pic_intr(cpu->apic_state)) {
+            if (apic_accept_pic_intr(cpu->apic_state) > 0) {
                 apic_deliver_pic_intr(cpu->apic_state, level);
             }
         }
-- 
1.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]