summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Roth <martin@coreboot.org>2020-07-28 09:42:07 -0600
committerPatrick Georgi <pgeorgi@google.com>2020-08-03 05:08:39 +0000
commit114cf22e8d9881aedc9ee72af5dfac74fdff5627 (patch)
tree4c468eb31969549abfd519a736d894ad1a9a1a3b
parent6880aec670661d961ab9baeb7fab0595d0ba906c (diff)
downloadcoreboot-114cf22e8d9881aedc9ee72af5dfac74fdff5627.tar.xz
drivers/amd/i2s_machine_dev: return if scope is NULL
Avoid dereferencing a null pointer. Found-by: Coverity CID 1430549 BUG=None TEST=Build Signed-off-by: Martin Roth <martin@coreboot.org> Change-Id: I53f6a38aac6e7f94c3c370996b3b82ca0d88dac4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/44001 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
-rw-r--r--src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c b/src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c
index a93826551d..b5be31d038 100644
--- a/src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c
+++ b/src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c
@@ -21,6 +21,11 @@ static void i2s_machine_dev_fill_ssdt(const struct device *dev)
dmic_select_gpio = &cfg->dmic_select_gpio;
+ if (scope == NULL) {
+ printk(BIOS_ERR, "%s: ERROR: ACPI I2S scope not found\n", dev_path(dev));
+ return;
+ }
+
if (cfg->hid == NULL) {
printk(BIOS_ERR, "%s: ERROR: HID required\n", dev_path(dev));
return;