iface-modem-firmware: fix reporting empty firmware list

ModemManager[2804]: <warn>  [1545055222.508649] No valid firmware images listed. Assuming firmware unsupported.
    ModemManager[2804]: <debug> [1545055222.508665] firmware list loading failed: unsupported
    ModemManager[2804]: <debug> [1545055222.508683] Couldn't load firmware image list: firmware list unknown
    ModemManager[2804]: <debug> [1545055222.508728] Couldn't load current firmware image: current firmware unknown

    (ModemManager:2804): GLib-CRITICAL **: 15:00:22.508: g_variant_builder_end: assertion '!GVSB(builder)->uniform_item_types || GVSB(builder)->prev_item_type != NULL || g_variant_type_is_definite (GVSB(builder)->type)' failed

    Thread 1 "ModemManager" received signal SIGTRAP, Trace/breakpoint trap.
    0x00007ffff75b39b6 in ?? () from /usr/lib/libglib-2.0.so.0
    (gdb) bt
    #0  0x00007ffff75b39b6 in  () at /usr/lib/libglib-2.0.so.0
    #1  0x00007ffff75b4363 in g_logv () at /usr/lib/libglib-2.0.so.0
    #2  0x00007ffff75b4560 in g_log () at /usr/lib/libglib-2.0.so.0
    #3  0x00007ffff758867d in g_variant_builder_end () at /usr/lib/libglib-2.0.so.0
    #4  0x00005555555e4d12 in load_current_ready (self=0x55555579c330, res=0x5555557388e0, ctx=0x5555557d6d80) at mm-iface-modem-firmware.c:84
    #5  0x00007ffff778f194 in  () at /usr/lib/libgio-2.0.so.0
    #6  0x00007ffff778f1c9 in  () at /usr/lib/libgio-2.0.so.0
    #7  0x00007ffff75c4271 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
    #8  0x00007ffff75c5f89 in  () at /usr/lib/libglib-2.0.so.0
    #9  0x00007ffff75c6f62 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
    #10 0x0000555555597aa0 in main (argc=2, argv=0x7fffffffe488) at main.c:181
This commit is contained in:
Aleksander Morgado
2018-12-17 15:04:25 +01:00
parent 85ac6f12f5
commit ef942ca564

View File

@@ -81,7 +81,7 @@ load_current_ready (MMIfaceModemFirmware *self,
} }
/* Build array of dicts */ /* Build array of dicts */
g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY); g_variant_builder_init (&builder, G_VARIANT_TYPE ("aa{sv}"));
for (l = ctx->list; l; l = g_list_next (l)) for (l = ctx->list; l; l = g_list_next (l))
g_variant_builder_add_value ( g_variant_builder_add_value (
&builder, &builder,