summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-06 18:05:59 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-06 18:07:08 +0200
commit33f7932e34d10b5429ea05332ef1e8421ef90916 (patch)
tree9916d5562bcc91a8322ad405bed57a8a8ae840d0
parente443a041117d0d09e81a9797d205e5b70c481b15 (diff)
only free unused devices after the final config init
-rw-r--r--config.c2
-rw-r--r--device.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/config.c b/config.c
index 23902ff..6f8d3b7 100644
--- a/config.c
+++ b/config.c
@@ -341,10 +341,10 @@ config_init_interfaces(const char *name)
if (!strcmp(s->type, "interface"))
config_parse_interface(s);
}
- device_free_unused(NULL);
config_init = false;
device_reset_old();
device_init_pending();
+ device_free_unused(NULL);
interface_start_pending();
}
diff --git a/device.c b/device.c
index bceba62..5b27ce0 100644
--- a/device.c
+++ b/device.c
@@ -292,7 +292,7 @@ void device_add_user(struct device_user *dep, struct device *dev)
static void
__device_free_unused(struct device *dev)
{
- if (!list_empty(&dev->users) || dev->current_config)
+ if (!list_empty(&dev->users) || dev->current_config || config_init)
return;
device_free(dev);