diff options
author | Mao Zhongyi | 2017-06-27 08:16:49 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2017-07-03 21:29:49 +0200 |
commit | 9a815774bb37d7290d2fa45a8cc313e9e9fdaa23 (patch) | |
tree | 6c4e6d90f846c791d9f61ef7f12f4e44f0c4d7b3 /hw/usb/hcd-xhci.c | |
parent | pci: Add comment for pci_add_capability2() (diff) | |
download | qemu-9a815774bb37d7290d2fa45a8cc313e9e9fdaa23.tar.gz qemu-9a815774bb37d7290d2fa45a8cc313e9e9fdaa23.tar.xz qemu-9a815774bb37d7290d2fa45a8cc313e9e9fdaa23.zip |
pci: Fix the wrong assertion.
pci_add_capability returns a strictly positive value on success,
correct asserts.
Cc: dmitry@daynix.com
Cc: jasowang@redhat.com
Cc: kraxel@redhat.com
Cc: alex.williamson@redhat.com
Cc: armbru@redhat.com
Cc: marcel@redhat.com
Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/usb/hcd-xhci.c')
-rw-r--r-- | hw/usb/hcd-xhci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 760135c0d2..204ea69d3f 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3419,7 +3419,7 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp) if (pci_bus_is_express(dev->bus) || xhci_get_flag(xhci, XHCI_FLAG_FORCE_PCIE_ENDCAP)) { ret = pcie_endpoint_cap_init(dev, 0xa0); - assert(ret >= 0); + assert(ret > 0); } if (xhci->msix != ON_OFF_AUTO_OFF) { |