diff options
author | Knut Omang <knut.omang@oracle.com> | 2012-12-18 22:36:29 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2012-12-26 11:49:28 +0200 |
commit | 812d2594d558f7c4f95c99c8fc58adc47ab68eb3 (patch) | |
tree | 48dd87eb2bea97ab33b5e9fa75f4435f3b3e154e /hw/pci | |
parent | d2a0ccc613ccc48c7240f99e1ce05e0acce6e2a1 (diff) |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 6c916d15ec..485c94c1b2 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); |