Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38669 )
Change subject: drivers/generic/gfx: Add null pointer error check ......................................................................
drivers/generic/gfx: Add null pointer error check
acpi_device_scope() will return NULL if it is unable to find the path of the parent device. Return early if this is the case to prevent a null pointer dereference.
Change-Id: I3eff1c1e3477c75c7130b52898de7d59692ba412 Signed-off-by: Jacob Garber jgarber1@ualberta.ca Found-by: Coverity CID 1409672 --- M src/drivers/generic/gfx/gfx.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/38669/1
diff --git a/src/drivers/generic/gfx/gfx.c b/src/drivers/generic/gfx/gfx.c index b2bda4a..0386e9b 100644 --- a/src/drivers/generic/gfx/gfx.c +++ b/src/drivers/generic/gfx/gfx.c @@ -69,6 +69,9 @@
const char *scope = acpi_device_scope(dev);
+ if (!scope) + return; + acpigen_write_scope(scope);
/* Method (_DOD, 0) */
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38669 )
Change subject: drivers/generic/gfx: Add null pointer error check ......................................................................
Patch Set 1: Code-Review+2
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38669 )
Change subject: drivers/generic/gfx: Add null pointer error check ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38669 )
Change subject: drivers/generic/gfx: Add null pointer error check ......................................................................
drivers/generic/gfx: Add null pointer error check
acpi_device_scope() will return NULL if it is unable to find the path of the parent device. Return early if this is the case to prevent a null pointer dereference.
Change-Id: I3eff1c1e3477c75c7130b52898de7d59692ba412 Signed-off-by: Jacob Garber jgarber1@ualberta.ca Found-by: Coverity CID 1409672 Reviewed-on: https://review.coreboot.org/c/coreboot/+/38669 Reviewed-by: David Hendricks david.hendricks@gmail.com Reviewed-by: HAOUAS Elyes ehaouas@noos.fr Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/drivers/generic/gfx/gfx.c 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified David Hendricks: Looks good to me, approved HAOUAS Elyes: Looks good to me, approved
diff --git a/src/drivers/generic/gfx/gfx.c b/src/drivers/generic/gfx/gfx.c index b2bda4a..0386e9b 100644 --- a/src/drivers/generic/gfx/gfx.c +++ b/src/drivers/generic/gfx/gfx.c @@ -69,6 +69,9 @@
const char *scope = acpi_device_scope(dev);
+ if (!scope) + return; + acpigen_write_scope(scope);
/* Method (_DOD, 0) */