mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-13 11:33:58 +00:00
hv: fix the vm pointer check before use
After using get_vm_from_vmid(), vm pointer is always not NULL. But there are still many NULL pointer checks. This commit replaced the NULL vm pointer check with a validation check which checks the vm status. In addition, NULL check for pointer returned by get_sos_vm() and get_vm_config() is removed. Tracked-On: #2520 Signed-off-by: Yan, Like <like.yan@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
committed by
ACRN System Integration
parent
275625af16
commit
ede1459e19
@@ -881,7 +881,7 @@ int32_t profiling_vm_list_info(struct acrn_vm *vm, uint64_t addr)
|
||||
|
||||
for (j = 0U; j < CONFIG_MAX_VM_NUM; j++) {
|
||||
tmp_vm = get_vm_from_vmid(j);
|
||||
if (tmp_vm == NULL) {
|
||||
if (!is_valid_vm(tmp_vm)) {
|
||||
break;
|
||||
}
|
||||
vm_info_list.num_vms++;
|
||||
|
||||
Reference in New Issue
Block a user