X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fpci.c;h=42e4c3a6e9511478b8950f804eb2fb225c29e2ec;hb=e3b62e7befa086a4fb320890952f54667ee46329;hp=3eadbc5768210368f3b0a672f697fb359204d594;hpb=91a4db3c4b06db6a44aa0daeaab750df666d5d79;p=palacios.git diff --git a/palacios/src/devices/pci.c b/palacios/src/devices/pci.c index 3eadbc5..42e4c3a 100644 --- a/palacios/src/devices/pci.c +++ b/palacios/src/devices/pci.c @@ -1202,6 +1202,12 @@ static struct v3_device_ops dev_ops = { static int pci_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { struct pci_internal * pci_state = V3_Malloc(sizeof(struct pci_internal)); + + if (!pci_state) { + PrintError("Cannot allocate in init\n"); + return -1; + } + int i = 0; char * dev_id = v3_cfg_val(cfg, "ID"); int ret = 0;