From 569711a4ffb375cea9569f733e6ea647037d4cbc Mon Sep 17 00:00:00 2001 From: Richard Spiegel Date: Tue, 7 Aug 2018 15:59:34 -0700 Subject: 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 Reviewed-on: https://review.coreboot.org/27951 Reviewed-by: Elyes HAOUAS Reviewed-by: Martin Roth Reviewed-by: Angel Pons Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- src/cpu/x86/mp_init.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/cpu') 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; -- cgit v1.2.3