diff options
-rw-r--r-- | src/mm-plugin.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c index 9dc84a4c..0e576569 100644 --- a/src/mm-plugin.c +++ b/src/mm-plugin.c @@ -498,16 +498,27 @@ mm_plugin_supports_port (MMPlugin *self, goto out; } + /* Need to launch new probing */ + probe = MM_PORT_PROBE (mm_device_get_port_probe (device, port)); + if (!probe) { + /* This may happen if the ports get removed from the device while + * probing is ongoing */ + g_simple_async_result_set_error (async_result, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "(%s) Missing port probe for port (%s/%s)", + self->priv->name, + g_udev_device_get_subsystem (port), + g_udev_device_get_name (port)); + g_simple_async_result_complete_in_idle (async_result); + goto out; + } + mm_dbg ("(%s) checking port support (%s,%s)", self->priv->name, g_udev_device_get_subsystem (port), g_udev_device_get_name (port)); - /* Need to launch new probing */ - - probe = MM_PORT_PROBE (mm_device_get_port_probe (device, port)); - g_assert (probe); - /* Before launching any probing, check if the port is a net device (which * cannot be probed). */ if (g_str_equal (g_udev_device_get_subsystem (port), "net")) { |