aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-07-17 08:31:02 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-08-06 20:07:22 +0200
commitda0226708a2ff8ec0fda82776b03ff02b626c9f5 (patch)
treea0261843b69f98ed686751f7844ecbe597b309d6 /src/mm-plugin.c
parent68c276efc1d7c856f8ce9790f384ae485fcaad66 (diff)
plugin: abort probing when the port has been released from the device
Diffstat (limited to 'src/mm-plugin.c')
-rw-r--r--src/mm-plugin.c21
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")) {