From 762f55ce9332b3d231e38233f7559edb4ed495e1 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 30 Jan 2015 10:45:27 +0100 Subject: [PATCH] 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 (cherry picked from commit 41c87eb363c7c12dbb87d7d5f9b4c96a8444bd0e) --- src/devices/wwan/nm-modem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ||