summaryrefslogtreecommitdiffhomepage
path: root/alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'alias.c')
-rw-r--r--alias.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/alias.c b/alias.c
index 3b14b87..951e046 100644
--- a/alias.c
+++ b/alias.c
@@ -124,7 +124,11 @@ alias_device_create(const char *name, struct device_type *devtype,
strcpy(alias->name, name);
alias->dev.set_state = alias_device_set_state;
alias->dev.hidden = true;
- device_init_virtual(&alias->dev, devtype, NULL);
+ if (device_init_virtual(&alias->dev, devtype, NULL) < 0) {
+ free(alias);
+ return NULL;
+ }
+
alias->avl.key = alias->name;
avl_insert(&aliases, &alias->avl);
alias->dep.alias = true;