If device_disable() returns being in progress, the technology has to be
disabled. Some technologies like 3G will call remove_device directly when
unplugging a modem and without disabling the corresponding technology,
the notifier enabled refcounts will get out pf sync.
static void remove_device(struct connman_device *device)
{
+ int err;
+
DBG("device %p", device);
- __connman_device_disable(device);
+ err = __connman_device_disable(device);
+ if (err < 0 && err == -EINPROGRESS)
+ __connman_technology_disable_device(device);
switch (device->mode) {
case CONNMAN_DEVICE_MODE_UNKNOWN:
DBG("device %p", device);
type = __connman_device_get_service_type(device);
- __connman_notifier_disable(type);
__connman_notifier_unregister(type);
technology = g_hash_table_lookup(device_table, device);