[PATCH] port-serial: fix command context completion when clearing command queue

Aleksander Morgado aleksander at aleksander.es
Tue Mar 18 07:12:05 PDT 2014


On 03/18/14 08:06, Ben Chan wrote:
> This patch removes an extra invocation of g_simple_async_result_complete
> on the result associated with each command context in the command queue
> when mm_port_serial_close clears the queue. It also changes the code to
> complete the results in idle, which avoids a nested invocation of
> mm_port_serial_close. That could happen if the completion of the result
> calls mm_port_serial_close again (e.g. via at_command_context_free,
> at_sequence_context_free in mm-base-modem-at.c). The nested invocation
> of mm_port_serial_close could create undesirable effects (e.g. the
> assertion on open_count > 0 fails in case of a forced close).
> ---

Pushed, thanks.

>  src/mm-port-serial.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/mm-port-serial.c b/src/mm-port-serial.c
> index e41beef..859acb7 100644
> --- a/src/mm-port-serial.c
> +++ b/src/mm-port-serial.c
> @@ -1378,8 +1378,7 @@ mm_port_serial_close (MMPortSerial *self)
>                                           MM_SERIAL_ERROR,
>                                           MM_SERIAL_ERROR_SEND_FAILED,
>                                           "Serial port is now closed");
> -        g_simple_async_result_complete (ctx->result);
> -        command_context_complete_and_free (ctx, FALSE);
> +        command_context_complete_and_free (ctx, TRUE);
>      }
>      g_queue_clear (self->priv->queue);
>  
> 


-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list