PCI/VPD: Use pci_read_vpd_any() in pci_vpd_size()
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 10 Sep 2021 06:22:49 +0000 (08:22 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 26 Oct 2021 00:12:23 +0000 (19:12 -0500)
commit3331325c6347492dfbe31f6b2bfdaee9b0689cd5
tree019b527b209f79eae4e4ecdcfbfc17a3a7e8c162
parentbf2928c7a284e31f9f91a004b5dca09c522157c0
PCI/VPD: Use pci_read_vpd_any() in pci_vpd_size()

Use new function pci_read_vpd_any() to simplify the code.

[bhelgaas: squash in fix for stack overflow reported & tested by
Qian [1] and Kunihiko [2]:
[1] https://lore.kernel.org/netdev/e89087c5-c495-c5ca-feb1-54cf3a8775c5@quicinc.com/
[2] https://lore.kernel.org/r/2f7e3770-ab47-42b5-719c-f7c661c07d28@socionext.com
Link: https://lore.kernel.org/r/6211be8a-5d10-8f3a-6d33-af695dc35caf@gmail.com
Reported-by: Qian Cai <quic_qiancai@quicinc.com>
Tested-by: Qian Cai <quic_qiancai@quicinc.com>
Reported-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Tested-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
]

Link: https://lore.kernel.org/r/049fa71c-c7af-9c69-51c0-05c1bc2bf660@gmail.com
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
drivers/pci/vpd.c