summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-11-28 16:27:07 (GMT)
committerDan Williams <dcbw@redhat.com>2012-12-05 17:27:54 (GMT)
commitc3984d3982ecce269451cb6d3a1ac2281bfc57b5 (patch)
treeb35c0ee90412606949340f39952849560008bea8
parentf0ba40f3a1c3ea34c84bfd94cc5f87c4e288f37d (diff)
huawei: fix crash disabling CDMA unsolicited response handlers
Parent MMBroadbandModem may not implement these functions so we shouldn't call them unless it does.
-rw-r--r--plugins/huawei/mm-broadband-modem-huawei.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c
index 1c32670..dcfa020 100644
--- a/plugins/huawei/mm-broadband-modem-huawei.c
+++ b/plugins/huawei/mm-broadband-modem-huawei.c
@@ -1498,11 +1498,20 @@ modem_cdma_cleanup_unsolicited_events (MMIfaceModemCdma *self,
/* Our own cleanup first */
set_cdma_unsolicited_events_handlers (MM_BROADBAND_MODEM_HUAWEI (self), FALSE);
- /* And now chain up parent's cleanup */
- iface_modem_cdma_parent->cleanup_unsolicited_events (
- self,
- (GAsyncReadyCallback)parent_cdma_cleanup_unsolicited_events_ready,
- result);
+ /* Chain up parent's setup if needed */
+ if (iface_modem_cdma_parent->cleanup_unsolicited_events &&
+ iface_modem_cdma_parent->cleanup_unsolicited_events_finish) {
+ iface_modem_cdma_parent->cleanup_unsolicited_events (
+ self,
+ (GAsyncReadyCallback)parent_cdma_cleanup_unsolicited_events_ready,
+ result);
+ return;
+ }
+
+ /* Otherwise we're done */
+ g_simple_async_result_set_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (result), TRUE);
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
}
/*****************************************************************************/