]> xenbits.xensource.com Git - people/andrewcoop/seabios.git/commitdiff
pci: fix the return value for truncated capability
authorJing Liu <jing2.liu@linux.intel.com>
Fri, 24 Aug 2018 08:52:59 +0000 (16:52 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 5 Sep 2018 06:37:18 +0000 (08:37 +0200)
Return zero when finding truncated capability.

Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
Message-id: 1535100781-3910-2-git-send-email-jing2.liu@linux.intel.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
src/fw/pciinit.c

index 3a2f7479848fbe0f292eb2c1277f8210da4befdc..d2cea2bb0d708af60bab7ef4f9263347480a2f39 100644 (file)
@@ -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;