summaryrefslogtreecommitdiff
path: root/macvlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'macvlan.c')
-rw-r--r--macvlan.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/macvlan.c b/macvlan.c
index 021d394..092f1dd 100644
--- a/macvlan.c
+++ b/macvlan.c
@@ -239,7 +239,12 @@ macvlan_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;