X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Ftelnet_cons.c;h=95623060dda8cd7b2366293bb28d330de03da5b0;hb=e61e0890e6f13b1362cfffdcd287e90f1d41e443;hp=b1558491fc47531b556c3e08ab1ccc7791ba8e29;hpb=5b1f618cf74dbcd7e490fa3fe4da5a4c53d79b5d;p=palacios.git diff --git a/palacios/src/devices/telnet_cons.c b/palacios/src/devices/telnet_cons.c index b155849..9562306 100644 --- a/palacios/src/devices/telnet_cons.c +++ b/palacios/src/devices/telnet_cons.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include @@ -528,6 +528,12 @@ static int cons_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { struct vm_device * frontend = v3_find_dev(vm, v3_cfg_val(frontend_cfg, "tag")); char * dev_id = v3_cfg_val(cfg, "ID"); + if (!state) { + PrintError("Cannot allocate in init\n"); + return -1; + } + + state->vm = vm; state->server_fd = 0; state->client_fd = 0;