Skip to content

Commit c244e8b

Browse files
JasonChenCJjren1
authored andcommitted
vpic: use calloc to init vpic instead of malloc
vpic struct should be init as 0 Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
1 parent eed8104 commit c244e8b

File tree

1 file changed

+1
-1
lines changed
  • hypervisor/arch/x86/guest

1 file changed

+1
-1
lines changed

hypervisor/arch/x86/guest/vpic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ void *vpic_init(struct vm *vm)
930930

931931
vpic_register_io_handler(vm);
932932

933-
vpic = malloc(sizeof(struct vpic));
933+
vpic = calloc(1, sizeof(struct vpic));
934934
ASSERT(vpic != NULL, "");
935935
vpic->vm = vm;
936936
vpic->pic[0].mask = 0xff;

0 commit comments

Comments
 (0)