diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c index f911a8b01..bd8eb33d1 100644 --- a/hypervisor/common/hypercall.c +++ b/hypervisor/common/hypercall.c @@ -535,6 +535,10 @@ int32_t hcall_set_vm_memory_regions(struct vm *vm, uint64_t param) } target_vm = get_vm_from_vmid(set_regions.vmid); + if (target_vm == NULL) { + return -EINVAL; + } + if (is_vm0(target_vm)) { pr_err("%s: Targeting to service vm", __func__); return -EFAULT;