Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

vcpu: Fix an issue of pointer checking #282

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion core/vcpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4503,7 +4503,11 @@ static void vcpu_init_cpuid(struct vcpu_t *vcpu)

if (vcpu->vcpu_id != 0) {
vcpu_0 = hax_get_vcpu(vcpu->vm->vm_id, 0, 0);
hax_assert(vcpu_0 != NULL);
if (vcpu_0 == NULL) {
hax_log(HAX_LOGE, "%s: initializing vCPU #%u with exception as "
"vCPU #0 is absent.\n", __func__, vcpu->vcpu_id);
return;
}
vcpu->guest_cpuid = vcpu_0->guest_cpuid;
hax_log(HAX_LOGI, "%s: referenced vcpu[%u].guest_cpuid to vcpu[%u].\n",
__func__, vcpu->vcpu_id, vcpu_0->vcpu_id);
Expand Down