summaryrefslogtreecommitdiffstats
path: root/src/soc
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-06-15 19:29:37 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-06-16 19:01:41 +0000
commit5d084ddb8763f3e9ff4498872d21e56ec5c7434e (patch)
treeb785cc27f8b148db7b8aa67d7124d8d6364dfbec /src/soc
parentec225f01b1ee86ac2985a36866c9a114bfe776be (diff)
downloadcoreboot-5d084ddb8763f3e9ff4498872d21e56ec5c7434e.tar.gz
coreboot-5d084ddb8763f3e9ff4498872d21e56ec5c7434e.tar.bz2
coreboot-5d084ddb8763f3e9ff4498872d21e56ec5c7434e.zip
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 <felix-coreboot@felixheld.de> Reported-by: Coverity (CID:1457506) Change-Id: I0523504d65725ab2d2df4db28a5dedd90697b917 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55541 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/amd/common/block/acpi/bert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/soc/amd/common/block/acpi/bert.c b/src/soc/amd/common/block/acpi/bert.c
index 207ee09563af..968c9a6dc02c 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;
}