X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Frtl8139.c;h=18e966a77dbd34f7901c2b9e0c6fda9a014a5023;hb=1b9bba809bf9c1d6ada56c7e4f8910e7afb82557;hp=fde3ef96e343d7f0aedeff88dc66bbcf47d12e24;hpb=3938dc8f325981eab29bda77f43fa1be1d91c54f;p=palacios.git diff --git a/palacios/src/devices/rtl8139.c b/palacios/src/devices/rtl8139.c index fde3ef9..18e966a 100644 --- a/palacios/src/devices/rtl8139.c +++ b/palacios/src/devices/rtl8139.c @@ -1806,6 +1806,12 @@ static int rtl8139_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { char * macstr = v3_cfg_val(cfg, "mac"); nic_state = (struct rtl8139_state *)V3_Malloc(sizeof(struct rtl8139_state)); + + if (!nic_state) { + PrintError("Cannot allocate in init\n"); + return -1; + } + memset(nic_state, 0, sizeof(struct rtl8139_state)); nic_state->pci_bus = pci_bus;