summaryrefslogtreecommitdiff
path: root/src/devices/wwan/nm-wwan-factory.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/wwan/nm-wwan-factory.c')
-rw-r--r--src/devices/wwan/nm-wwan-factory.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/devices/wwan/nm-wwan-factory.c b/src/devices/wwan/nm-wwan-factory.c
index 59512cf38e..7a93b47c7b 100644
--- a/src/devices/wwan/nm-wwan-factory.c
+++ b/src/devices/wwan/nm-wwan-factory.c
@@ -64,13 +64,16 @@ modem_added_cb (NMModemManager *manager,
gpointer user_data)
{
NMWwanFactory *self = NM_WWAN_FACTORY (user_data);
- NMDevice *device;
+ gs_unref_object NMDevice *device = NULL;
const char *driver;
/* Do nothing if the modem was consumed by some other plugin */
if (nm_device_factory_emit_component_added (NM_DEVICE_FACTORY (self), G_OBJECT (modem)))
return;
+ if (nm_modem_is_claimed (modem))
+ return;
+
driver = nm_modem_get_driver (modem);
/* If it was a Bluetooth modem and no bluetooth device claimed it, ignore
@@ -85,9 +88,7 @@ modem_added_cb (NMModemManager *manager,
/* Make the new modem device */
device = nm_device_modem_new (modem);
- g_assert (device);
g_signal_emit_by_name (self, NM_DEVICE_FACTORY_DEVICE_ADDED, device);
- g_object_unref (device);
}
static NMDevice *