summaryrefslogtreecommitdiff
path: root/hw/e1000.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/e1000.c')
-rw-r--r--hw/e1000.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/e1000.c b/hw/e1000.c
index 1729db28e1..b0fe917342 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -1063,6 +1063,9 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn)
d = (E1000State *)pci_register_device(bus, "e1000",
sizeof(E1000State), devfn, NULL, NULL);
+ if (!d)
+ return NULL;
+
pci_conf = d->dev.config;
memset(pci_conf, 0, 256);