pci: Assign a default value on reads on error
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Mon, 7 Jul 2025 16:26:53 +0000 (17:26 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 14 Jul 2025 21:16:48 +0000 (15:16 -0600)
commit22039ef94a8f6e7f4fc04648dc5a0ee857927be3
tree17dd960b4ab1a944050a68730ec6679e6728a765
parent6a269b7fdefe3edc60a6218f1402f17206644628
pci: Assign a default value on reads on error

Many callers of PCI read functions do not check the return value for
error before using the variable that should contain the value read were
there not to be an error. However in the error case this variable is
never assigned to and so will contain uninitialised data.
To provide some certainty as to behaviour in the error case assign a
default value of all bits set.

This issue found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/pci/pci-uclass.c