diff options
author | Ben Chan <benchan@chromium.org> | 2013-06-27 21:50:28 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-06-28 07:35:53 +0200 |
commit | 5be1ce6ee165373288ea6852d6148f724b61e68f (patch) | |
tree | 8eb1de3e8e834bf4620ea04da2a83b270d4cfa46 | |
parent | 49f017abfff0a513f0592ccad9beff4cf17d0d21 (diff) |
novatel-lte: propagate error when load_current_bands fails
This patch fixes the following crash when
MMIfaceModem::load_current_bands_ready() dereferences a NULL GError
pointer, which happens when the novatel-lte plugin fails to load the
current bands but does not propagate the error.
Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 )
0x7f04d6c89c36 [ModemManager] - mm-iface-modem.c:3886 load_current_bands_ready
0x7f04d6942236 [libgio-2.0.so.0.3200.4] - gsimpleasyncresult.c:767 g_simple_async_result_complete
0x7f04d6942338 [libgio-2.0.so.0.3200.4] - gsimpleasyncresult.c:779 complete_in_idle_cb
0x7f04d67fad74 [libglib-2.0.so.0.3200.4] - gmain.c:2539 g_main_context_dispatch
0x7f04d67fb0f7 [libglib-2.0.so.0.3200.4] - gmain.c:3146 g_main_context_iterate
0x7f04d67fb551 [libglib-2.0.so.0.3200.4] - gmain.c:3340 g_main_loop_run
0x7f04d6c68795 [ModemManager] - main.c:142] main
0x7f04d6213464 [libc-2.15.so] - libc-start.c:234] __libc_start_main
0x7f04d6c68318 [ModemManager] + 0x0001d318]
-rw-r--r-- | plugins/novatel/mm-broadband-modem-novatel-lte.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/novatel/mm-broadband-modem-novatel-lte.c b/plugins/novatel/mm-broadband-modem-novatel-lte.c index 0db16863..8cb127aa 100644 --- a/plugins/novatel/mm-broadband-modem-novatel-lte.c +++ b/plugins/novatel/mm-broadband-modem-novatel-lte.c @@ -376,7 +376,9 @@ load_current_bands_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - /* Never fails */ + if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + return NULL; + return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer ( G_SIMPLE_ASYNC_RESULT (res))); } |