summaryrefslogtreecommitdiff
path: root/hw/msix.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-07-05 15:58:52 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-10 13:44:30 -0500
commit72755a709619b1db204c675df8f1093d54e38128 (patch)
tree08b78c68572a0bee7b67cf44887e7ab4b2885a14 /hw/msix.c
parent4bfd1712d787db62586e620cb84d35f6afa5b772 (diff)
downloadqemu-72755a709619b1db204c675df8f1093d54e38128.tar.gz
qemu/msi: missing braces
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 <blauwirbel@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/msix.c')
-rw-r--r--hw/msix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/msix.c b/hw/msix.c
index 47e014017c..3420ce9b24 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);