Received: from eggs.gnu.org ([208.118.235.92]:53767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl4q5-0002bQ-Vg for qemu-devel@nongnu.org; Tue, 18 Dec 2012 16:36:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tl4q3-0001Py-2U for qemu-devel@nongnu.org; Tue, 18 Dec 2012 16:36:37 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:34781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl4q2-0001Pe-Py for qemu-devel@nongnu.org; Tue, 18 Dec 2012 16:36:35 -0500 Message-ID: <1355866589.8438.6.camel@ori.omang.mine.nu> From: Knut Omang Date: Tue, 18 Dec 2012 22:36:29 +0100 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Subject: [Qemu-devel] [PATCH] pcie: Fix bug in pcie_ext_cap_set_next List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Michael S.Tsirkin" Upper 16 bits of the PCIe Extended Capability Header was truncated during update, also breaking pcie_add_capability. Signed-off-by: Knut Omang --- hw/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pcie.c b/hw/pcie.c index 7c92f19..fa260af 100644 --- a/hw/pcie.c +++ b/hw/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); -- 1.7.11.7