diff options
| author | Michael Brown | 2022-02-16 13:30:02 +0100 |
|---|---|---|
| committer | Michael Brown | 2022-02-16 13:55:28 +0100 |
| commit | 04288974f6d81019314cbf9cbd72ab1fae95496f (patch) | |
| tree | e34966223f084e094ebf08f827ce1596d59bfb6e /src/include/ipxe | |
| parent | [image] Do not clear current working URI when executing embedded image (diff) | |
| download | ipxe-04288974f6d81019314cbf9cbd72ab1fae95496f.tar.gz ipxe-04288974f6d81019314cbf9cbd72ab1fae95496f.tar.xz ipxe-04288974f6d81019314cbf9cbd72ab1fae95496f.zip | |
[pci] Ensure that pci_read_config() initialises all fields
As per the general pattern for initialisation functions in iPXE,
pci_init() saves code size by assuming that the caller has already
zeroed the underlying storage (e.g. as part of zeroing a larger
containing structure). There are several places within the code where
pci_init() is deliberately used to initialise a transient struct
pci_device without zeroing the entire structure, because the calling
code knows that only the PCI bus:dev.fn address is required to be
initialised (e.g. when reading from PCI configuration space).
Ensure that using pci_init() followed by pci_read_config() will fully
initialise the struct pci_device even if the caller did not previously
zero the underlying storage, since Coverity reports that there are
several places in the code that rely upon this.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
0 files changed, 0 insertions, 0 deletions
