PCI config read functions

Andrew Goodbody andrew.goodbody at linaro.org
Fri Jul 4 11:53:55 CEST 2025


Hi Tom,

Smatch reports that the callers of the functions 
(dm_)pci_config_read(8|16|32) from drivers/pci/pci-uclass.c do not check 
the return value for an error before using the variable that should have 
been assigned with the value read. However in the error path that 
variable is not assigned to and so the code can use an uninitialised 
variable in that case.
eg line 1396 in drivers/pci/pci-uclass.c addr may not have been assigned 
to in the error case.

This also seems to be the case with callers from other files as well.

Would a patch that adds a default assignment before returning an error 
to the affected functions be accepted?

Thanks,
Andrew


More information about the U-Boot mailing list