summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Held <felix.held@amd.corp-partner.google.com>2020-06-27 15:11:36 +0200
committerFelix Held <felix-coreboot@felixheld.de>2020-06-29 16:04:27 +0000
commit3858fb121e4322f7a835b23622bf9452790fcec6 (patch)
tree98e1d57447d42020238391cf9f578dec3db56fe8
parentc077f4a84cac69d2bf6ff71d7a4065bfff614a69 (diff)
soc/amd/picasso: add NULL-pointer check to root_complex_fill_ssdt
Found-by: Coverity CID 1429980 Change-Id: Ia72b9dbe029a5da98e408a9cf16fa4a93b10917a Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/42846 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
-rw-r--r--src/soc/amd/picasso/root_complex.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/soc/amd/picasso/root_complex.c b/src/soc/amd/picasso/root_complex.c
index 4930a0e87f..036ff00ccb 100644
--- a/src/soc/amd/picasso/root_complex.c
+++ b/src/soc/amd/picasso/root_complex.c
@@ -135,6 +135,12 @@ static void root_complex_fill_ssdt(const struct device *device)
{
msr_t msr;
+ if (!device) {
+ printk(BIOS_ERR, "%s: device is NULL! ACPI SSDT will be incomplete.\n",
+ __func__);
+ return;
+ }
+
acpigen_write_scope(acpi_device_scope(device));
msr = rdmsr(TOP_MEM);