sys/smp: Free buffer and return NULL on zero APs in AArch64 ACPI path
diff --git a/common/sys/smp.c b/common/sys/smp.c
index 75c29390..9435fb47 100644
--- a/common/sys/smp.c
+++ b/common/sys/smp.c
@@ -552,6 +552,11 @@ static struct limine_mp_info *try_acpi_smp(size_t *cpu_count,
}
}
+ if (*cpu_count == 0) {
+ pmm_free(ret, max_cpus * sizeof(struct limine_mp_info));
+ return NULL;
+ }
+
return ret;
}
