From 705212dac9961398f552b749bddb0bc113dd2f18 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Wed, 2 Dec 2020 13:17:46 +1100 Subject: 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 Reviewed-on: https://review.coreboot.org/c/flashrom/+/48225 Tested-by: build bot (Jenkins) Reviewed-by: Sam McNally Reviewed-by: Angel Pons --- chipset_enable.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'chipset_enable.c') diff --git a/chipset_enable.c b/chipset_enable.c index 5e4a547d..7c98798c 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -996,6 +996,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); -- cgit v1.2.3