[PATCH] Fixed cgmi_retries in dell_custom_init

Aleksander Morgado aleksander at aleksander.es
Wed Apr 6 08:54:51 UTC 2016


On Tue, Apr 5, 2016 at 8:18 AM, Carlo Lobrano <c.lobrano at gmail.com> wrote:
> Initialized "cgmi_retries" variable from CustomInitContext with the
> same value as the other retries, moreover the context is now allocated
> with g_slice_new0.
>
> Before this changes, when cgmi_retries assumed big values during the
> probing of no AT-capable ports, the command AT+CGMI (mm-plugin-dell.c:custom_init_step)
> was sent a semi-infinite number of times, blocking the plugin's initialization.

Nice one! thanks, pushed to git master.

> ---
>  plugins/dell/mm-plugin-dell.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/plugins/dell/mm-plugin-dell.c b/plugins/dell/mm-plugin-dell.c
> index 0dff19b..ced1f3b 100644
> --- a/plugins/dell/mm-plugin-dell.c
> +++ b/plugins/dell/mm-plugin-dell.c
> @@ -297,7 +297,7 @@ dell_custom_init (MMPortProbe *probe,
>  {
>      CustomInitContext *ctx;
>
> -    ctx = g_slice_new (CustomInitContext);
> +    ctx = g_slice_new0 (CustomInitContext);
>      ctx->result = g_simple_async_result_new (G_OBJECT (probe),
>                                               callback,
>                                               user_data,
> @@ -306,6 +306,7 @@ dell_custom_init (MMPortProbe *probe,
>      ctx->port = g_object_ref (port);
>      ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
>      ctx->gmi_retries = 3;
> +    ctx->cgmi_retries = 3;
>      ctx->ati_retries = 3;
>
>      custom_init_step (ctx);
> --
> 2.1.4
>
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel



-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list