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>
This commit is contained in:
Felix Held 2020-06-27 15:11:36 +02:00 committed by Felix Held
parent c077f4a84c
commit 3858fb121e
1 changed files with 6 additions and 0 deletions

View File

@ -135,6 +135,12 @@ static void root_complex_fill_ssdt(const struct device *device)
{ {
msr_t msr; 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)); acpigen_write_scope(acpi_device_scope(device));
msr = rdmsr(TOP_MEM); msr = rdmsr(TOP_MEM);