Lean Sheng Tan has submitted this change. ( https://review.coreboot.org/c/coreboot/+/75506?usp=email )
Change subject: soc/amd/block/ivrs: Add NULL check for IVRS ......................................................................
soc/amd/block/ivrs: Add NULL check for IVRS
Add NULL check for ivrs pointer before use.
Signed-off-by: Naresh Solanki Naresh.Solanki@9elements.com Change-Id: Ibeb0ea3bcaa3512a93500588ad4f11046edee61f Reviewed-on: https://review.coreboot.org/c/coreboot/+/75506 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Eric Lai eric_lai@quanta.corp-partner.google.com Reviewed-by: Lean Sheng Tan sheng.tan@9elements.com --- M src/soc/amd/common/block/acpi/ivrs.c 1 file changed, 5 insertions(+), 0 deletions(-)
Approvals: Lean Sheng Tan: Looks good to me, approved build bot (Jenkins): Verified Eric Lai: Looks good to me, approved
diff --git a/src/soc/amd/common/block/acpi/ivrs.c b/src/soc/amd/common/block/acpi/ivrs.c index 089b42d..ca58c35 100644 --- a/src/soc/amd/common/block/acpi/ivrs.c +++ b/src/soc/amd/common/block/acpi/ivrs.c @@ -310,6 +310,11 @@ struct device *nb_dev; struct device *dev = NULL;
+ if (ivrs == NULL) { + printk(BIOS_WARNING, "%s: ivrs is NULL\n", __func__); + return current; + } + ivhd = &ivrs->ivhd;
while ((dev = dev_find_path(dev, DEVICE_PATH_DOMAIN)) != NULL) {