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>
This commit is contained in:
Richard Spiegel 2018-08-07 15:59:34 -07:00 committed by Martin Roth
parent cc9b3348d2
commit 569711a4ff
1 changed files with 1 additions and 0 deletions

View File

@ -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;