Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44001 )
Change subject: drivers/amd/i2s_machine_dev: return if scope is NULL ......................................................................
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 --- M src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c 1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/44001/1
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 a938265..b5be31d 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 @@
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;
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44001 )
Change subject: drivers/amd/i2s_machine_dev: return if scope is NULL ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/44001 )
Change subject: drivers/amd/i2s_machine_dev: return if scope is NULL ......................................................................
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 --- M src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c 1 file changed, 5 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
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 a938265..b5be31d 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 @@
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;