]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
pci: Fix building of 32bit PCI command array
authorPeter Krempa <pkrempa@redhat.com>
Wed, 5 Dec 2012 10:58:39 +0000 (11:58 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 5 Dec 2012 13:04:54 +0000 (14:04 +0100)
The pciWrite32 function assembled the array of data to be written to the
fd with a bad offset on the last byte. This issue was probably caused by
a typo (14, 24).

src/util/pci.c

index 8bded78bfe6befc2644a041ddf26196732323efb..597176435a63e20d8376f384d66e2ba35ab44ff3 100644 (file)
@@ -268,7 +268,7 @@ pciWrite16(pciDevice *dev, int cfgfd, unsigned pos, uint16_t val)
 static void
 pciWrite32(pciDevice *dev, int cfgfd, unsigned pos, uint32_t val)
 {
-    uint8_t buf[4] = { (val >> 0), (val >> 8), (val >> 16), (val >> 14) };
+    uint8_t buf[4] = { (val >> 0), (val >> 8), (val >> 16), (val >> 24) };
     pciWrite(dev, cfgfd, pos, &buf[0], sizeof(buf));
 }