diff options
author | Edward O'Callaghan <quasisec@google.com> | 2020-12-02 13:17:46 +1100 |
---|---|---|
committer | Felix Singer <felixsinger@posteo.net> | 2022-09-29 17:05:24 +0000 |
commit | 2e3e10669d719545968ddec3b44b8a9363f4b432 (patch) | |
tree | 95f7807b9ec68fdc9d21590fc7c174ee0f391fca | |
parent | eaf701dc68e1b6a38542c3c856b0c9a2fb5a826d (diff) | |
download | flashrom-2e3e10669d719545968ddec3b44b8a9363f4b432.tar.gz flashrom-2e3e10669d719545968ddec3b44b8a9363f4b432.tar.bz2 flashrom-2e3e10669d719545968ddec3b44b8a9363f4b432.zip |
chipset_enable.c: Validate physmap() return rcrb value
Validate the physical mapping in enable_flash_silvermont().
Change-Id: Icc5a799a06b3f310d9a191fa5eb99b255b20d79d
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/48225
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sam McNally <sammc@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67868
Reviewed-by: Felix Singer <felixsinger@posteo.net>
-rw-r--r-- | chipset_enable.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chipset_enable.c b/chipset_enable.c index 5195b9503..bbd046530 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -988,6 +988,8 @@ static int enable_flash_silvermont(struct pci_dev *dev, const char *name) /* Handle GCS (in RCRB) */ void *rcrb = physmap("BYT RCRB", rcba, 4); + if (rcrb == ERROR_PTR) + return ERROR_FATAL; const enum chipbustype boot_buses = enable_flash_ich_report_gcs(dev, ich_generation, rcrb); physunmap(rcrb, 4); |