X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Ftelnet_cons.c;h=fc03c88ea438a2d339aa4ac65b1b685cb7c4c793;hb=72420d58d18ec71d4777d029daaf0c6a1c820b32;hp=8c052b9edb9fe97df5b796d34687579e795602fb;hpb=e2964f7234daa3429275c039769a313f0870c212;p=palacios.releases.git diff --git a/palacios/src/devices/telnet_cons.c b/palacios/src/devices/telnet_cons.c index 8c052b9..fc03c88 100644 --- a/palacios/src/devices/telnet_cons.c +++ b/palacios/src/devices/telnet_cons.c @@ -531,10 +531,11 @@ static int cons_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { v3_lock_init(&(state->cons_lock)); - struct vm_device * dev = v3_allocate_device(dev_id, &dev_ops, state); + struct vm_device * dev = v3_add_device(vm, dev_id, &dev_ops, state); - if (v3_attach_device(vm, dev) == -1) { + if (dev == NULL) { PrintError("Could not attach device %s\n", dev_id); + V3_Free(state); return -1; }