summaryrefslogtreecommitdiffhomepage
path: root/vlandev.c
diff options
context:
space:
mode:
Diffstat (limited to 'vlandev.c')
-rw-r--r--vlandev.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vlandev.c b/vlandev.c
index 7e46251..ceaeb3e 100644
--- a/vlandev.c
+++ b/vlandev.c
@@ -222,7 +222,13 @@ vlandev_create(const char *name, struct device_type *devtype,
return NULL;
dev = &mvdev->dev;
- device_init(dev, devtype, name);
+
+ if (device_init(dev, devtype, name) < 0) {
+ device_cleanup(dev);
+ free(mvdev);
+ return NULL;
+ }
+
dev->config_pending = true;
mvdev->set_state = dev->set_state;