[PATCH] iface-modem: free GError when interface initialization is cancelled

Aleksander Morgado aleksander at lanedo.com
Sun Sep 15 22:52:53 PDT 2013


On 14/09/13 08:14, Ben Chan wrote:
> This patch fixes an assertion failure 'ctx->fatal_error == NULL' in
> initialization_context_complete_and_free(), which happens if
> 'fatal_error' of the initialization context is set during the modem
> interface initialization and the initialization is later cancelled.
> ---

Pushed, thanks.

>  src/mm-iface-modem.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
> index c599050..748a720 100644
> --- a/src/mm-iface-modem.c
> +++ b/src/mm-iface-modem.c
> @@ -3530,6 +3530,12 @@ initialization_context_complete_and_free_if_cancelled (InitializationContext *ct
>      if (!g_cancellable_is_cancelled (ctx->cancellable))
>          return FALSE;
>  
> +    /* Simply ignore any fatal error encountered as the initialization is cancelled anyway. */
> +    if (ctx->fatal_error) {
> +        g_error_free (ctx->fatal_error);
> +        ctx->fatal_error = NULL;
> +    }
> +
>      g_simple_async_result_set_error (ctx->result,
>                                       MM_CORE_ERROR,
>                                       MM_CORE_ERROR_CANCELLED,
> 


-- 
Aleksander


More information about the ModemManager-devel mailing list