---
 src/technology.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/technology.c b/src/technology.c
index fb28ca5..439714a 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -723,12 +723,16 @@ void __connman_technology_remove_interface(enum 
connman_service_type type,
 
        technology = technology_find(type);
 
-       if (technology == NULL || technology->driver == NULL)
+       if (technology == NULL)
                return;
 
+       if (technology->driver == NULL)
+               goto done;
+
        if (technology->driver->remove_interface)
                technology->driver->remove_interface(technology, index);
 
+done:
        technology_put(technology);
 }
 
@@ -774,10 +778,8 @@ int __connman_technology_remove_device(struct 
connman_device *device)
 
        technology->device_list = g_slist_remove(technology->device_list,
                                                                device);
-       if (technology->device_list == NULL) {
-               technology->state = CONNMAN_TECHNOLOGY_STATE_OFFLINE;
-               state_changed(technology);
-       }
+       if (technology->device_list == NULL)
+               technology_put(technology);
 
        return 0;
 }
-- 
1.7.2.2

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to