From: Peter Dinda Date: Tue, 28 May 2013 22:23:15 +0000 (-0500) Subject: Memory alloction bugfix for vmm_events X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=0ab9a336e36f49b43d9918c09087c6826ce04c83;p=palacios.releases.git Memory alloction bugfix for vmm_events --- diff --git a/palacios/include/palacios/vmm_events.h b/palacios/include/palacios/vmm_events.h index afc1194..7c97613 100644 --- a/palacios/include/palacios/vmm_events.h +++ b/palacios/include/palacios/vmm_events.h @@ -28,8 +28,9 @@ struct guest_info; struct v3_vm_info; -typedef enum { - V3_EVENT_INVALID /* This entry must always be last */ +typedef enum { + /* First event must be zero */ + V3_EVENT_INVALID /* This entry must always be last */ } v3_event_type_t; diff --git a/palacios/src/palacios/vmm_events.c b/palacios/src/palacios/vmm_events.c index 535db09..c4580ee 100644 --- a/palacios/src/palacios/vmm_events.c +++ b/palacios/src/palacios/vmm_events.c @@ -28,7 +28,7 @@ int v3_init_events(struct v3_vm_info * vm) { struct v3_event_map * map = &(vm->event_map); int i = 0; - map->events = V3_Malloc(sizeof(struct list_head) * V3_EVENT_INVALID); + map->events = V3_Malloc(sizeof(struct list_head) * (V3_EVENT_INVALID+1)); if (map->events == NULL) { PrintError(vm, VCORE_NONE, "Error: could not allocate event map\n");