From: Jing Liu Date: Fri, 24 Aug 2018 08:52:59 +0000 (+0800) Subject: pci: fix the return value for truncated capability X-Git-Tag: rel-1.12.0~7 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2c455ccc0cd67412983b6ae575190d5036256817;p=seabios.git pci: fix the return value for truncated capability Return zero when finding truncated capability. Signed-off-by: Jing Liu Message-id: 1535100781-3910-2-git-send-email-jing2.liu@linux.intel.com Signed-off-by: Gerd Hoffmann --- diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index 3a2f747..d2cea2b 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -539,6 +539,7 @@ static u8 pci_find_resource_reserve_capability(u16 bdf) if (cap_len < RES_RESERVE_CAP_SIZE) { dprintf(1, "PCI: QEMU resource reserve cap length %d is invalid\n", cap_len); + return 0; } } return cap;