hv: Check pcpu number in Hw platform detect
if the physical number > CONFIG_MAX_PCPU_NUM,
will return error and panic.
Acked-by: Eddie Dong
@@ -259,6 +259,11 @@ static int hardware_detect_support(void)
return -ENODEV;
}
+ if (phys_cpu_num > CONFIG_MAX_PCPU_NUM) {
+ pr_fatal("%s, pcpu number(%d) is out of range\n", __func__, phys_cpu_num);
+ return -ENODEV;
+ }
+
ret = check_vmx_mmu_cap();
if (ret != 0) {
return ret;
