aboutsummaryrefslogtreecommitdiff
path: root/src/mm-broadband-modem.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-10-31 10:54:25 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-10-31 10:54:25 +0100
commitdaf1a353c32e3bbf182e8c9c2948c35627c3111d (patch)
treef5cb0e57639ec7f63bb1be538f3630fe109ec84b /src/mm-broadband-modem.c
parent25d35b6f915b65565ec90d17bfdaa96a7e6c391f (diff)
core: allow QMI modems without AT ports
Diffstat (limited to 'src/mm-broadband-modem.c')
-rw-r--r--src/mm-broadband-modem.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 11725989..95a61cdb 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -6584,7 +6584,8 @@ initialization_stopped (MMBroadbandModem *self,
{
PortsContext *ctx = (PortsContext *)user_data;
- ports_context_unref (ctx);
+ if (ctx)
+ ports_context_unref (ctx);
return TRUE;
}
@@ -6609,12 +6610,13 @@ initialization_started_finish (MMBroadbandModem *self,
GAsyncResult *res,
GError **error)
{
+ gpointer ref;
+
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
return NULL;
- return ((gpointer) ports_context_ref (
- g_simple_async_result_get_op_res_gpointer (
- G_SIMPLE_ASYNC_RESULT (res))));
+ ref = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
+ return ref ? ports_context_ref (ref) : NULL;
}
static gboolean
@@ -7622,8 +7624,9 @@ initialization_started_ready (MMBroadbandModem *self,
GError *error = NULL;
gpointer ports_ctx;
+ /* May return NULL without error */
ports_ctx = MM_BROADBAND_MODEM_GET_CLASS (self)->initialization_started_finish (self, result, &error);
- if (!ports_ctx) {
+ if (error) {
mm_warn ("Couldn't start initialization: %s", error->message);
g_error_free (error);