From 5d084ddb8763f3e9ff4498872d21e56ec5c7434e Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 15 Jun 2021 19:29:37 +0200 Subject: soc/amd/common/block/acpi/bert: fix NULL check In acpi_soc_get_bert_region after the bert_errors_region call is was checked if the region parameter is NULL after the call; since region is a parameter of acpi_soc_get_bert_region, it's non-NULL. What we should be checking here is if region points to a non-NULL pointer. Signed-off-by: Felix Held Reported-by: Coverity (CID:1457506) Change-Id: I0523504d65725ab2d2df4db28a5dedd90697b917 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55541 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel Reviewed-by: Angel Pons --- src/soc/amd/common/block/acpi/bert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/soc/amd/common/block') diff --git a/src/soc/amd/common/block/acpi/bert.c b/src/soc/amd/common/block/acpi/bert.c index 207ee09563..968c9a6dc0 100644 --- a/src/soc/amd/common/block/acpi/bert.c +++ b/src/soc/amd/common/block/acpi/bert.c @@ -16,7 +16,7 @@ enum cb_err acpi_soc_get_bert_region(void **region, size_t *length) return CB_ERR; bert_errors_region(region, length); - if (!region) { + if (!*region) { printk(BIOS_ERR, "Error: Can't find BERT storage area\n"); return CB_ERR; } -- cgit v1.2.3