diff options
author | Dan Williams <dcbw@redhat.com> | 2012-11-28 10:27:07 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2012-12-05 11:27:54 -0600 |
commit | c3984d3982ecce269451cb6d3a1ac2281bfc57b5 (patch) | |
tree | b35c0ee90412606949340f39952849560008bea8 | |
parent | f0ba40f3a1c3ea34c84bfd94cc5f87c4e288f37d (diff) | |
download | ModemManager-c3984d3982ecce269451cb6d3a1ac2281bfc57b5.tar.gz |
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.c | 19 |
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 1c32670cb..dcfa020df 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); } /*****************************************************************************/ |