altair-lte: propagate error when load_{supported,current}_bands fails

This patch fixes a potential crash when
MMIfaceModem::load_current_bands_ready() dereferences a NULL GError
pointer, which happens when the altair-lte plugin fails to load the
current bands but does not propagate the error. It also fixes a similar
issue with the plugin fails to load the supported bands, even though
MMIfaceModem::load_supported_bands_ready() checks for a NULL GError
pointer.
This commit is contained in:
Ben Chan
2013-06-27 21:51:25 -07:00
committed by Aleksander Morgado
parent 5be1ce6ee1
commit 989210bfd8

View File

@@ -286,7 +286,9 @@ load_supported_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)));
}
@@ -365,7 +367,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)));
}