Skip to content
Commit e7870c2c authored by Andrew Scull's avatar Andrew Scull Committed by Tom Rini
Browse files

virtio: pci: Read entire capability into memory



Read the virtio PCI capability out of the device configuration space to
a struct rather than accessing fields directly from the configuration
space as they are needed. This both makes access to the fields easier
and avoids re-reading fields.

Re-reading fields could result in time-of-check to time-of-use problems,
should the value in the configuration space change. The range check of
the `bar` field and the later call to `dm_pci_read_bar32()` is an
example of where this could happen.

Signed-off-by: default avatarAndrew Scull <ascull@google.com>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent 6a8cb878
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment