aboutsummaryrefslogtreecommitdiff
path: root/hw/pci
diff options
context:
space:
mode:
authorKnut Omang <knut.omang@oracle.com>2012-12-18 22:36:29 +0100
committerMichael S. Tsirkin <mst@redhat.com>2012-12-26 11:49:28 +0200
commit812d2594d558f7c4f95c99c8fc58adc47ab68eb3 (patch)
tree48dd87eb2bea97ab33b5e9fa75f4435f3b3e154e /hw/pci
parentd2a0ccc613ccc48c7240f99e1ce05e0acce6e2a1 (diff)
downloadqemu-812d2594d558f7c4f95c99c8fc58adc47ab68eb3.zip
qemu-812d2594d558f7c4f95c99c8fc58adc47ab68eb3.tar.gz
qemu-812d2594d558f7c4f95c99c8fc58adc47ab68eb3.tar.bz2
pcie: Fix bug in pcie_ext_cap_set_next
Upper 16 bits of the PCIe Extended Capability Header was truncated during update, also breaking pcie_add_capability. Signed-off-by: Knut Omang <knut.omang@oracle.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci')
-rw-r--r--hw/pci/pcie.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 6c916d1..485c94c 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -494,7 +494,7 @@ uint16_t pcie_find_capability(PCIDevice *dev, uint16_t cap_id)
static void pcie_ext_cap_set_next(PCIDevice *dev, uint16_t pos, uint16_t next)
{
- uint16_t header = pci_get_long(dev->config + pos);
+ uint32_t header = pci_get_long(dev->config + pos);
assert(!(next & (PCI_EXT_CAP_ALIGN - 1)));
header = (header & ~PCI_EXT_CAP_NEXT_MASK) |
((next << PCI_EXT_CAP_NEXT_SHIFT) & PCI_EXT_CAP_NEXT_MASK);