X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Flnx_virtio_console.c;h=0c0f4bc7728bcf3c6d72c85860d15313304d7900;hb=e61e0890e6f13b1362cfffdcd287e90f1d41e443;hp=0afefb8a2b26732506518463643510101e684798;hpb=3938dc8f325981eab29bda77f43fa1be1d91c54f;p=palacios.git diff --git a/palacios/src/devices/lnx_virtio_console.c b/palacios/src/devices/lnx_virtio_console.c index 0afefb8..0c0f4bc 100644 --- a/palacios/src/devices/lnx_virtio_console.c +++ b/palacios/src/devices/lnx_virtio_console.c @@ -434,6 +434,12 @@ static int virtio_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { virtio_state = (struct virtio_console_state *)V3_Malloc(sizeof(struct virtio_console_state)); + + if (!virtio_state) { + PrintError("Cannot allocate in init\n"); + return -1; + } + memset(virtio_state, 0, sizeof(struct virtio_console_state));