summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard Spiegel <richard.spiegel@amd.corp-partner.google.com>2018-08-07 15:59:34 -0700
committerMartin Roth <martinroth@google.com>2018-08-09 15:46:40 +0000
commit569711a4ffb375cea9569f733e6ea647037d4cbc (patch)
tree4f32d4c3105ac45ba6c576a52088da63ad774c08 /src
parentcc9b3348d2c7e142e04cc9d5b42d3208293e3847 (diff)
downloadcoreboot-569711a4ffb375cea9569f733e6ea647037d4cbc.tar.xz
cpu/x86/mp_init.c: Fix error treatment
In procedure allocate_cpu_devices(), if structure pointer new is null skip using the pointer. Add a "continue;" to skip using the pointer. The issue was found by static analysis tool. BUG=b:112253891 TEST=Build and boot grunt. Change-Id: I7011fbfa0725f22a6dfbca6752e668eddac3463c Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com> Reviewed-on: https://review.coreboot.org/27951 Reviewed-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/cpu/x86/mp_init.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index d124721bd0..ff02b16eed 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -404,6 +404,7 @@ static int allocate_cpu_devices(struct bus *cpu_bus, struct mp_params *p)
if (new == NULL) {
printk(BIOS_CRIT, "Could not allocate CPU device\n");
max_cpus--;
+ continue;
}
new->name = processor_name;
cpus[i].dev = new;