[MM] [PATCH] 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]
---
 plugins/novatel/mm-broadband-modem-novatel-lte.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plugins/novatel/mm-broadband-modem-novatel-lte.c 
b/plugins/novatel/mm-broadband-modem-novatel-lte.c
index 0db1686..8cb127a 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)));
 }
-- 
1.8.3



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]