Skip to content

Commit cb26228

Browse files
yonghuahlijinxia
authored andcommitted
HV: add NULL pointer check in 'vm_fixup()' function.
- to clear security warning. Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
1 parent 6d63cb3 commit cb26228

File tree

1 file changed

+5
-0
lines changed
  • hypervisor/arch/x86/guest

1 file changed

+5
-0
lines changed

hypervisor/arch/x86/guest/vm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,11 @@ void vm_fixup(struct vm *vm)
368368
int i;
369369

370370
vm_desc = get_vm_desc(0);
371+
if (vm_desc == NULL) {
372+
pr_err("get VM0 description failed.");
373+
return;
374+
}
375+
371376
foreach_vcpu(i, vm, vcpu) {
372377
if (!vcpu_in_vm_desc(vcpu, vm_desc)) {
373378
pause_vcpu(vcpu, VCPU_ZOMBIE);

0 commit comments

Comments
 (0)