alias: clean up device dependencies on free
authorFelix Fietkau <nbd@openwrt.org>
Thu, 28 Jan 2016 21:37:25 +0000 (22:37 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 28 Jan 2016 21:37:25 +0000 (22:37 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
alias.c

diff --git a/alias.c b/alias.c
index cef125f578d4e6da125138180e28e9309772cd42..01bec41f309f2c3cbef433491270455e83ee80c1 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -130,6 +130,8 @@ static void alias_device_free(struct device *dev)
        struct alias_device *alias;
 
        alias = container_of(dev, struct alias_device, dev);
+       device_remove_user(&alias->new_dep);
+       device_remove_user(&alias->dep);
        avl_delete(&aliases, &alias->avl);
        free(alias);
 }