X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fsimple_pic.c;h=16039e40d75a0862ca991de86a546ab4c2c12342;hb=da0b4bb80de755529f47b9ca57ccb0c2cefae15b;hp=96907df2823ad31b190b1ed9286d99846dd72f70;hpb=37c18b2c2335a41c68c2f0b779fd2b7d51ab216d;p=palacios.git diff --git a/palacios/src/devices/simple_pic.c b/palacios/src/devices/simple_pic.c index 96907df..16039e4 100644 --- a/palacios/src/devices/simple_pic.c +++ b/palacios/src/devices/simple_pic.c @@ -82,12 +82,17 @@ static struct v3_device_ops dev_ops = { static int pic_init(struct guest_info * vm, void * cfg_data) { struct pic_internal * state = NULL; state = (struct pic_internal *)V3_Malloc(sizeof(struct pic_internal)); - V3_ASSERT(state != NULL); + + if (!state) { + PrintError(info->vm_info, info, "Cannot allocate in init\n"); + return -1; + } struct vm_device * dev = v3_allocate_device("SIMPLE_PIC", &dev_ops, state); if (v3_attach_device(vm, dev) == -1) { - PrintError("Could not attach device %s\n", "SIMPLE_PIC"); + PrintError(info->vm_info, info, "Could not attach device %s\n", "SIMPLE_PIC"); + V3_Free(state); return -1; }