summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ipconfig.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c
index b4729903..f817699f 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -1330,7 +1330,8 @@ void connman_ipconfig_unref(struct connman_ipconfig *ipconfig)
if (__sync_fetch_and_sub(&ipconfig->refcount, 1) != 1)
return;
- __connman_ipconfig_disable(ipconfig);
+ if (__connman_ipconfig_disable(ipconfig) < 0)
+ ipconfig_list = g_list_remove(ipconfig_list, ipconfig);
connman_ipconfig_set_ops(ipconfig, NULL);