From c3984d3982ecce269451cb6d3a1ac2281bfc57b5 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 28 Nov 2012 10:27:07 -0600 Subject: huawei: fix crash disabling CDMA unsolicited response handlers Parent MMBroadbandModem may not implement these functions so we shouldn't call them unless it does. --- plugins/huawei/mm-broadband-modem-huawei.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c index 1c32670c..dcfa020d 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); } /*****************************************************************************/ -- cgit v1.2.3