diff options
-rw-r--r-- | src/technology.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/technology.c b/src/technology.c index 0a89b1a5..a5366dc3 100644 --- a/src/technology.c +++ b/src/technology.c @@ -580,7 +580,7 @@ void __connman_technology_add_interface(enum connman_service_type type, void __connman_technology_remove_interface(enum connman_service_type type, int index, const char *name, const char *ident) { - GSList *list; + struct connman_technology *technology; switch (type) { case CONNMAN_SERVICE_TYPE_UNKNOWN: @@ -600,20 +600,15 @@ void __connman_technology_remove_interface(enum connman_service_type type, connman_info("Remove interface %s [ %s ]", name, __connman_service_type2string(type)); - for (list = technology_list; list; list = list->next) { - struct connman_technology *technology = list->data; - - if (technology->type != type) - continue; + technology = technology_find(type); - if (technology->driver == NULL) - continue; + if (technology == NULL || technology->driver == NULL) + return; - if (technology->driver->remove_interface) - technology->driver->remove_interface(technology, index); + if (technology->driver->remove_interface) + technology->driver->remove_interface(technology, index); - technology_put(technology); - } + technology_put(technology); } static void unregister_technology(gpointer data) |