on interface free, remove the main_dev user if still present
authorFelix Fietkau <nbd@openwrt.org>
Mon, 3 Oct 2011 00:49:59 +0000 (02:49 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 3 Oct 2011 00:49:59 +0000 (02:49 +0200)
interface.c

index 435b485dc901ba2226e572e9f41392a6d4bf5165..e67c695228b71decd1e8e26d76c8cf3734038d4d 100644 (file)
@@ -169,6 +169,8 @@ interface_set_available(struct interface *iface, bool new_state)
 static void
 interface_do_free(struct interface *iface)
 {
+       if (iface->main_dev.dev)
+               device_remove_user(&iface->main_dev);
        interface_set_proto_state(iface, NULL);
        free(iface->config);
        netifd_ubus_remove_interface(iface);