summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-01-30 10:45:27 +0100
committerLubomir Rintel <lkundrak@v3.sk>2015-02-04 10:54:59 +0100
commit41c87eb363c7c12dbb87d7d5f9b4c96a8444bd0e (patch)
tree850c641866a9eef34fee2ff22b8570493357fdba
parentf9e4af2d86251f4b9947fea3198f9aabf1f89ed5 (diff)
downloadNetworkManager-41c87eb363c7c12dbb87d7d5f9b4c96a8444bd0e.tar.gz
wwan: fix wrong assert in deactivate_cleanup()
When the modem device is abruptly disconnected, nm_modem_device_state_changed() calls deactivate_cleanup() with a NULL device argument and that's perfectly fine. We should only check the instance type if we know the device is non-NULL. (NetworkManager:9166): NetworkManager-wwan-CRITICAL **: deactivate_cleanup: assertion 'NM_IS_DEVICE ( failed
-rw-r--r--src/devices/wwan/nm-modem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c
index e2f380ab31..af8abed651 100644
--- a/src/devices/wwan/nm-modem.c
+++ b/src/devices/wwan/nm-modem.c
@@ -847,7 +847,6 @@ deactivate_cleanup (NMModem *self, NMDevice *device)
int ifindex;
g_return_if_fail (NM_IS_MODEM (self));
- g_return_if_fail (NM_IS_DEVICE (device));
priv = NM_MODEM_GET_PRIVATE (self);
@@ -867,6 +866,8 @@ deactivate_cleanup (NMModem *self, NMDevice *device)
}
if (device) {
+ g_return_if_fail (NM_IS_DEVICE (device));
+
if (priv->ip4_method == NM_MODEM_IP_METHOD_STATIC ||
priv->ip4_method == NM_MODEM_IP_METHOD_AUTO ||
priv->ip6_method == NM_MODEM_IP_METHOD_STATIC ||