PCI/VPD: Allow access to valid parts of VPD if some is invalid
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 15 Jul 2021 21:59:59 +0000 (16:59 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 9 Aug 2021 18:43:09 +0000 (13:43 -0500)
commit5fe204eab174fd474227f23fd47faee4e7a6c000
treef579bbbe7fea8a1a2c069127050a26d6f3f4c202
parent7fa75dd8c64590850a54991a8bb914667c512b4c
PCI/VPD: Allow access to valid parts of VPD if some is invalid

Previously, if we found any error in the VPD, we returned size 0, which
prevents access to all of VPD.  But there may be valid resources in VPD
before the error, and there's no reason to prevent access to those.

"off" covers only VPD resources known to have valid header tags.  In case
of error, return "off" (which may be zero if we haven't found any valid
header tags at all).

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
drivers/pci/vpd.c