qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [COMMIT 72755a7] qemu/msi: missing braces


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT 72755a7] qemu/msi: missing braces
Date: Fri, 10 Jul 2009 20:40:30 -0000

From: Michael S. Tsirkin <address@hidden>

MSIX present bit is tested incorrectly, and only happens to work because
the bit we are testing is 0x1.  Add braces to fix this.

Reported-by: Blue Swirl <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/hw/msix.c b/hw/msix.c
index 47e0140..3420ce9 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -286,8 +286,9 @@ void msix_save(PCIDevice *dev, QEMUFile *f)
 {
     unsigned n = dev->msix_entries_nr;
 
-    if (!dev->cap_present & QEMU_PCI_CAP_MSIX)
+    if (!(dev->cap_present & QEMU_PCI_CAP_MSIX)) {
         return;
+    }
 
     qemu_put_buffer(f, dev->msix_table_page, n * MSIX_ENTRY_SIZE);
     qemu_put_buffer(f, dev->msix_table_page + MSIX_PAGE_PENDING, (n + 7) / 8);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]