summaryrefslogtreecommitdiffstats
path: root/chipset_enable.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2020-10-15 19:19:05 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2020-10-27 11:33:02 +0000
commitda0825f05f0d8d1af2e12ab3ccf950051a3eb608 (patch)
treef32d01406c791bdcb57634bc512dca6e4bae2a41 /chipset_enable.c
parentc15de25a7ca6504a4191f8da44448a0723923e58 (diff)
downloadflashrom-da0825f05f0d8d1af2e12ab3ccf950051a3eb608.tar.gz
flashrom-da0825f05f0d8d1af2e12ab3ccf950051a3eb608.tar.bz2
flashrom-da0825f05f0d8d1af2e12ab3ccf950051a3eb608.zip
chipset_enable.c: check return value from rphysmap() call
Port from the ChromiumOS fork of flashrom. Change-Id: I8075fe5f80ac0da5280d2f0de6829ed3a2496476 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/46444 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sam McNally <sammc@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'chipset_enable.c')
-rw-r--r--chipset_enable.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/chipset_enable.c b/chipset_enable.c
index 9769ba45c..427347868 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -1010,6 +1010,8 @@ static int enable_flash_silvermont(struct pci_dev *dev, const char *name)
uint32_t sbase = pci_read_long(dev, 0x54) & 0xfffffe00;
msg_pdbg("SPI_BASE_ADDRESS = 0x%x\n", sbase);
void *spibar = rphysmap("BYT SBASE", sbase, 512); /* Last defined address on Bay Trail is 0x100 */
+ if (spibar == ERROR_PTR)
+ return ERROR_FATAL;
/* Enable Flash Writes.
* Silvermont-based: BCR at SBASE + 0xFC (some bits of BCR are also accessible via BC at IBASE + 0x1C).